From fc27d690339958d531ee6187ab01107448cb8486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 15 Nov 2021 12:59:33 +0100 Subject: [PATCH] steam.exe: Make process system after child process has started. So that it can connect to the winstation and get a desktop reference before steam.exe releases theirs. CW-Bug-ID: #19584 --- steam_helper/steam.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index cae268d2..7e27867d 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -1376,8 +1376,6 @@ int main(int argc, char *argv[]) SteamAPI_Shutdown(); - NtSetInformationProcess( GetCurrentProcess(), (PROCESS_INFORMATION_CLASS)1000 /* ProcessWineMakeProcessSystem */, - &wait_handle, sizeof(HANDLE *) ); game_process = TRUE; } @@ -1397,14 +1395,17 @@ int main(int argc, char *argv[]) if (child == INVALID_HANDLE_VALUE) return 1; - if (wait_handle == INVALID_HANDLE_VALUE) - wait_handle = child; + wait_handle = child; } if (game_process) CreateThread(NULL, 0, steam_drm_thread, child, 0, NULL); } + if (game_process) + NtSetInformationProcess( GetCurrentProcess(), (PROCESS_INFORMATION_CLASS)1000 /* ProcessWineMakeProcessSystem */, + &wait_handle, sizeof(HANDLE *) ); + if(wait_handle != INVALID_HANDLE_VALUE) { FreeConsole();