https://bugs.winehq.org/show_bug.cgi?id=39663
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Summary|GOG Galaxy slow to start |GOG Galaxy client 1.x hangs |(20 second delay) |or reports 'Something went | |wrong during | |DeelevateStrategy' error | |in Win7 mode (GOG Galaxy | |service needs | |wtsapi32.WTSQueryUserToken | |implementation) CC| |focht@gmx.net
--- Comment #15 from Anastasius Focht focht@gmx.net --- Hello folks,
please don't mix in different issues in one bug report!
Since it has a working Wine-Staging patchset for 'wtsapi32.WTSQueryUserToken' insufficiency lets limit it for that issue.
All other issues caused by MS VC++ runtime and gdiplus insufficiencies or broken WINEPREFIXes are obsolete and don't belong here.
Relevant part of trace log from GOG Galaxy client v1.2
0009: -> GOG client process 0035: -> GOG service process
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/GOG Galaxy
$ WINEDEBUG=+tid,+seh,+relay,+service wine ./GalaxyClient.exe >>log.txt 2>&1 ... 0009:Call shell32.IsUserAnAdmin() ret=0040f307 0009:Call advapi32.OpenProcessToken(ffffffff,00000008,0033f4bc) ret=7e7d3c6f 0009:Ret advapi32.OpenProcessToken() retval=00000001 ret=7e7d3c6f 0009:Call advapi32.GetTokenInformation(00000108,00000002,00000000,00000000,0033f4b8) ret=7e7d3c96 0009:Ret advapi32.GetTokenInformation() retval=00000000 ret=7e7d3c96 0009:Call advapi32.GetTokenInformation(00000108,00000002,00176ac0,000000dc,0033f4b8) ret=7e7d3d23 0009:Ret advapi32.GetTokenInformation() retval=00000001 ret=7e7d3d23 0009:Call KERNEL32.CloseHandle(00000108) ret=7e7d3d6f 0009:Ret KERNEL32.CloseHandle() retval=00000001 ret=7e7d3d6f 0009:Call advapi32.AllocateAndInitializeSid(0033f4c2,00000002,00000020,00000220,00000000,00000000,00000000,00000000,00000000,00000000,0033f4b4) ret=7e7d3d97 0009:Ret advapi32.AllocateAndInitializeSid() retval=00000001 ret=7e7d3d97 0009:Call advapi32.EqualSid(00177258,00176afc) ret=7e7d3de5 0009:Ret advapi32.EqualSid() retval=00000000 ret=7e7d3de5 0009:Call advapi32.EqualSid(00177258,00176b08) ret=7e7d3de5 0009:Ret advapi32.EqualSid() retval=00000000 ret=7e7d3de5 0009:Call advapi32.EqualSid(00177258,00176b14) ret=7e7d3de5 0009:Ret advapi32.EqualSid() retval=00000000 ret=7e7d3de5 0009:Call advapi32.EqualSid(00177258,00176b20) ret=7e7d3de5 0009:Ret advapi32.EqualSid() retval=00000000 ret=7e7d3de5 0009:Call advapi32.EqualSid(00177258,00176b2c) ret=7e7d3de5 0009:Ret advapi32.EqualSid() retval=00000001 ret=7e7d3de5 0009:Call advapi32.FreeSid(00177258) ret=7e7d3e0f 0009:Ret advapi32.FreeSid() retval=00000000 ret=7e7d3e0f 0009:Ret shell32.IsUserAnAdmin() retval=00000001 ret=0040f307 ... 0009:Call KERNEL32.GetVersionExW(0033f400) ret=0052ded0 0009:Ret KERNEL32.GetVersionExW() retval=00000001 ret=0052ded0 ... 0009:Call KERNEL32.OpenMutexA(00100000,00000000,009a0838 "Global\clientUpdaterSingleInstanceMutexName") ret=00438dd2 ... 0009:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,0033b330,00004000,0077ed00 "Requesting service to run process: %s, with arguments: %s.",00000000,0033f360) ret=0052ea04 ... 0009:Call advapi32.OpenServiceW(00176af0,0099ec98 L"GalaxyClientService",00000010) ret=0064ae47 ... 0014:Call KERNEL32.CreateProcessW(00000000,0011c780 L""C:\Program Files\GOG Galaxy\GalaxyClientService.exe"",00000000,00000000,00000000,00000400,00440000,00000000,0064e41c,0064e460) ret=7ed6c56b ... 0014:Ret KERNEL32.CreateProcessW() retval=00000001 ret=7ed6c56b ... 0035:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,00c2a450,00004000,004388b4 "Received LaunchElevatedRequest %s",00000000,00c2e480) ret=0040f5a4 ... 0035:Call wtsapi32.WTSQueryUserToken(00000001,00c2e2a8) ret=0040d85a 0035:fixme:wtsapi:WTSQueryUserToken 1 0xc2e2a8 0035:Ret wtsapi32.WTSQueryUserToken() retval=00000000 ret=0040d85a ... 0035:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,00c2a1f0,00004000,00438df8 "Couldn't get query user token, error code %d",00000000,00c2e220) ret=0040f5a4 ... 0035:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,00c2a450,00004000,004388d8 "LaunchElevatedRequest complete: %d",00000000,00c2e480) ret=0040f5a4 ... 0035:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,00c2a354,00004000,0043b800 "Sending response of type %u [Sequence Number: %u], rseq %u, size %u (bytes sent: %d), completed OK",00000000,00c2e384) ret=0040f5a4 ... 0009:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,003399fc,00004000,0077eb90 "Sending data for run process request to service complete",00000000,0033da2c) ret=0052ea04 ... 0035:Call ucrtbase.__stdio_common_vsprintf(00000006,00000000,00c2a454,00004000,004388fc "LaunchElevatedRequest response sent",00000000,00c2e484) ret=0040f5a4 ... --- snip ---
'GalaxyClientService.log':
--- snip --- 2017-08-20 11:50:20.607 [Information][ (0)]: Log started. Application version: 1.2.17.9 (2017-07-27 16:29). 2017-08-20 11:50:20.609 [Information][ (0)]: Operating system: Windows 7 6.1 (Build 7601: Service Pack 1) (IA32) 2017-08-20 11:50:20.609 [Information][ (0)]: Platform identification: win7 32bit 2017-08-20 11:50:20.611 [Information][ (0)]: Service starting 2017-08-20 11:50:20.612 [Information][ (0)]: Started to listen on port 9978 2017-08-20 11:50:20.613 [Information][#1 (1)]: ServiceServer connected 2017-08-20 11:50:20.614 [Information][#1 (1)]: Received LaunchElevatedRequest 3245476907 2017-08-20 11:50:20.614 [Error][#1 (1)]: Couldn't get query user token, error code 0 2017-08-20 11:50:20.614 [Information][#1 (1)]: LaunchElevatedRequest complete: 1 2017-08-20 11:50:20.614 [Information][#1 (1)]: Sending response of type 2 [Sequence Number: 3245476907], rseq 3245476907, size 17 (bytes sent: 17), completed OK 2017-08-20 11:50:20.614 [Information][#1 (1)]: LaunchElevatedRequest response sent 2017-08-20 11:50:20.614 [Information][#1 (1)]: Connection closed by remote host 2017-08-20 11:50:20.615 [Information][#1 (1)]: ServiceConnectionHandler disconnecting --- snip ---
With Wine-Staging 2.14:
Client log:
--- snip --- 2017-08-20 19:07:35.853 [Information][ (0)]: Log started. Application version: 1.2.17.9 (2017-07-27 16:29). 2017-08-20 19:07:35.854 [Information][ (0)]: Operating system: Windows 7 6.1 (Build 7601: Service Pack 1) (IA32) 2017-08-20 19:07:35.854 [Information][ (0)]: Platform identification: win7 32bit 2017-08-20 19:07:35.854 [Information][ (0)]: Running InitClientStrategy. 2017-08-20 19:07:35.854 [Information][ (0)]: Client launched via auto start 2017-08-20 19:07:35.863 [Information][ (0)]: Requesting service to fix privileges for dir C:\Program Files\GOG Galaxy 2017-08-20 19:07:35.865 [Information][ (0)]: Sending message of type 3 [Sequence Number: 4288868353], rseq 0, size 43 (bytes sent: 43), completed OK 2017-08-20 19:07:35.865 [Information][ (0)]: Request sent [Sequence Number: 4288868353], waiting for response... 2017-08-20 19:07:36.720 [Information][ (0)]: Sending data for fix privileges request to service complete 2017-08-20 19:07:36.720 [Information][ (0)]: Launching process. Command: C:\users\Public\Application Data\GOG.com\Galaxy\redists\GalaxyUpdater.exe, Initial Directory: C:\users\Public\Application Data/GOG.com/Galaxy/redists, Elevated: false, Arguments: { /clientUpdatePath="C:\Program Files\GOG Galaxy" /previousClientVersion="1.2.17.9" /redistUpdatePath="C:\users\Public\Application Data/GOG.com/Galaxy/redists" /updateClient /updateRedist /updateStrategy="Prefetch" } 2017-08-20 19:07:36.730 [Information][ (0)]: Changing setting launchParams from '[]' to '["/deelevated","/launchViaAutoStart"]' 2017-08-20 19:07:36.731 [Information][ (0)]: Used InitClientStrategy to launch application. Command-line parameters: /deelevated /launchViaAutoStart 2017-08-20 19:07:36.731 [Information][ (0)]: Initialization strategy 'InitClientStrategy' returned exit code 'Launching Updater; exiting.'. The client will exit. 2017-08-20 19:07:42.469 [Information][ (0)]: Log started. Application version: 1.2.17.9 (2017-07-27 16:29). 2017-08-20 19:07:42.469 [Information][ (0)]: Operating system: Windows 7 6.1 (Build 7601: Service Pack 1) (IA32) 2017-08-20 19:07:42.469 [Information][ (0)]: Platform identification: win7 32bit 2017-08-20 19:07:42.469 [Information][ (0)]: Running InitClientStrategy. 2017-08-20 19:07:42.478 [Information][ (0)]: Requesting service to fix privileges for dir C:\Program Files\GOG Galaxy 2017-08-20 19:07:42.480 [Information][ (0)]: Sending message of type 3 [Sequence Number: 260352511], rseq 0, size 42 (bytes sent: 42), completed OK 2017-08-20 19:07:42.480 [Information][ (0)]: Request sent [Sequence Number: 260352511], waiting for response... 2017-08-20 19:07:43.333 [Information][ (0)]: Sending data for fix privileges request to service complete 2017-08-20 19:07:43.333 [Information][ (0)]: The client update is disabled, continuing. 2017-08-20 19:07:43.333 [Information][ (0)]: Used InitClientStrategy to launch application. Command-line parameters: /deelevated /runWithoutUpdating 2017-08-20 19:07:43.333 [Information][ (0)]: Initialization strategy 'InitClientStrategy' returned exit code 'Returned successfully.'. The client will continue. 2017-08-20 19:07:43.333 [Information][ (0)]: Switching logger from 'C:\users\Public\Application Data\GOG.com\Galaxy\logs\GalaxyInitialization.log' to log to 'C:\users\Public\Application Data\GOG.com\Galaxy\logs\GalaxyClient.log'. --- snip ---
Service:
--- snip --- 2017-08-20 19:07:35.689 [Information][ (0)]: Log started. Application version: 1.2.17.9 (2017-07-27 16:29). 2017-08-20 19:07:35.689 [Information][ (0)]: Operating system: Windows 7 6.1 (Build 7601: Service Pack 1) (IA32) 2017-08-20 19:07:35.689 [Information][ (0)]: Platform identification: win7 32bit 2017-08-20 19:07:35.691 [Information][ (0)]: Service starting 2017-08-20 19:07:35.692 [Information][ (0)]: Started to listen on port 9978 2017-08-20 19:07:35.692 [Information][#1 (1)]: ServiceServer connected 2017-08-20 19:07:35.693 [Information][#1 (1)]: Received LaunchElevatedRequest 3948359654 2017-08-20 19:07:35.695 [Information][#1 (1)]: Default working dir: C:\Program Files\GOG Galaxy\ 2017-08-20 19:07:36.703 [Information][#1 (1)]: Created process as user. Process path: C:\Program Files\GOG Galaxy\GalaxyClient.exe, command line "C:\Program Files\GOG Galaxy\GalaxyClient.exe" /launchViaAutoStart /deelevated , working directory: C:\Program Files\GOG Galaxy\ 2017-08-20 19:07:36.703 [Information][#1 (1)]: LaunchElevatedRequest complete: 0 2017-08-20 19:07:36.704 [Information][#1 (1)]: Sending message of type 2 [Sequence Number: 0], rseq 3948359654, size 21 (bytes sent: 21), completed OK 2017-08-20 19:07:36.704 [Information][#1 (1)]: LaunchElevatedRequest response sent 2017-08-20 19:07:36.704 [Information][#1 (1)]: ServiceServer connected 2017-08-20 19:07:36.704 [Information][#1 (1)]: Connection closed by remote host 2017-08-20 19:07:36.704 [Information][#1 (1)]: ServiceConnectionHandler disconnecting --- snip ---
The service re-runs the client with:
--- snip --- 004d:Call advapi32.CreateProcessAsUserW(000000c4,0073a588 L"C:\Program Files\GOG Galaxy\GalaxyClient.exe",0073a4d8 L""C:\Program Files\GOG Galaxy\GalaxyClient.exe" /deelevated ",00000000,00000000,00000000,00000428,00c50000,0073a6d8 L"C:\Program Files\GOG Galaxy\",00c4e224,00c4e27c) ret=0040db8c ... 004d:Ret advapi32.CreateProcessAsUserW() retval=00000001 ret=0040db8c --- snip ---
which ought to run the process with restricted token.
Fortunately the client checks are kinda lazy (by design?): if any client process command line parameter contains '/deelevated' it won't request de-elevation again, regardless what 'shell32.IsUserAnAdmin()' returns.
$ sha1sum setup_galaxy_1.2.17.9.exe 931b2049fb9f1d66e937d823144023f3e2ca9d3d setup_galaxy_1.2.17.9.exe
$ du -sh setup_galaxy_1.2.17.9.exe 155M setup_galaxy_1.2.17.9.exe
$ wine --version wine-2.15
Regards