diff options
author | Andrew Eikum <aeikum@codeweavers.com> | 2021-10-27 17:25:56 +0300 |
---|---|---|
committer | Arkadiusz Hiler <ahiler@codeweavers.com> | 2021-11-11 19:36:07 +0300 |
commit | fdc3651992b38ed2b316f92ccf7406f2ac88c005 (patch) | |
tree | 793c7f3bd3b97a8fca6a4115e3734c526f937a1c /steam_helper | |
parent | ef7b6fd07e1c6a37a307aebcc383da3e10d7e79a (diff) |
proton: Return the real application return code on exit.
CW-Bug-Id: #15930
Diffstat (limited to 'steam_helper')
-rw-r--r-- | steam_helper/steam.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index a2bdd126..e1f08357 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -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; } |