proton: Return the real application return code on exit.

CW-Bug-Id: #15930
This commit is contained in:
Andrew Eikum 2021-10-27 09:25:56 -05:00 committed by Arkadiusz Hiler
parent ef7b6fd07e
commit fdc3651992
2 changed files with 19 additions and 10 deletions

View file

@ -1268,7 +1268,9 @@ int main(int argc, char *argv[])
HANDLE wait_handle = INVALID_HANDLE_VALUE;
HANDLE event2 = INVALID_HANDLE_VALUE;
HANDLE event = INVALID_HANDLE_VALUE;
HANDLE child = INVALID_HANDLE_VALUE;
BOOL game_process = FALSE;
DWORD rc = 0;
WINE_TRACE("\n");
@ -1311,7 +1313,6 @@ int main(int argc, char *argv[])
if (argc > 1)
{
HANDLE child;
BOOL should_await;
setup_vrpaths();
@ -1328,8 +1329,6 @@ int main(int argc, char *argv[])
if (wait_handle == INVALID_HANDLE_VALUE)
wait_handle = child;
else
CloseHandle(child);
}
if (game_process)
@ -1346,5 +1345,12 @@ int main(int argc, char *argv[])
CloseHandle(event);
if (event2 != INVALID_HANDLE_VALUE)
CloseHandle(event2);
return 0;
if (child != INVALID_HANDLE_VALUE)
{
GetExitCodeProcess(child, &rc);
CloseHandle(child);
}
return rc;
}