1
0
mirror of synced 2025-02-21 20:59:31 +01:00

Merge branch 'teknogods:master' into master

This commit is contained in:
EmuAl 2022-01-08 09:29:45 +00:00 committed by GitHub
commit f6a55f9838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include <winternl.h>
@ -204,11 +204,12 @@ int wmain(int argc, wchar_t* argv[])
// With arguments
if (argc == 4)
{
wchar_t args[MAX_PATH];
swprintf(args, MAX_PATH, L"%ls", argv[3]);
size_t cmdSize = wcslen(gamePathW) + wcslen(argv[3]) + 4;
wchar_t* cmdW = new wchar_t[cmdSize]{ 0 };
swprintf(cmdW, cmdSize, L"\"%ls\" %ls", gamePathW, argv[3]);
if (!CreateProcess(gamePathW, // No module name (use command line).
args, // Command line.
cmdW, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.