Skip to content

Commit 32c0986

Browse files
committed
Add CreateProcessW fallback to launch GTA
1 parent 4aabd6e commit 32c0986

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Client/loader/MainFunctions.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,16 @@ BOOL StartGtaProcess(const SString& lpApplicationName, const SString& lpCommandL
10521052

10531053
if (bResult == FALSE)
10541054
{
1055-
dwOutError = GetLastError();
1056-
strOutErrorContext = "ShellExecute";
1055+
STARTUPINFOW startupInfo{};
1056+
startupInfo.cb = sizeof(startupInfo);
1057+
bResult = CreateProcessW(*FromUTF8(lpApplicationName), FromUTF8(lpCommandLine).data(), nullptr, nullptr, FALSE, 0, nullptr,
1058+
*FromUTF8(lpCurrentDirectory), &startupInfo, lpProcessInformation);
1059+
1060+
if (!bResult)
1061+
{
1062+
dwOutError = GetLastError();
1063+
strOutErrorContext = "CreateProcess";
1064+
}
10571065
}
10581066
else
10591067
{

0 commit comments

Comments
 (0)