https://bugs.winehq.org/show_bug.cgi?id=47186
Bug ID: 47186 Summary: Star Wars - The Old Republic (SWTOR) client/launcher fails with 'Installation of drivers require admin permission' (BitRaider)(existing service dependencies must be preserved by SCM when passed NULL) Product: Wine Version: 4.8 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
continuation of bug 47176
There is a helper (console) app which is used to install and configure BitRaider. At least three log file locations are of interest during boostrapping of the game installer/launcher which includes set up of BitRaider.
--- snip --- .wine/drive_c/ProgramData/BitRaider/common/logs/BR_Debuglog.txt ... .wine/drive_c/Star Wars-The Old Republic/bitraider/logs/swtor_swtor.txt ... .wine/drive_c/Star Wars-The Old Republic/logs/launcher_20190511.log --- snip ---
'swtor_swtor.txt'
--- snip --- ... 2019/05/11 10:18:36.921:[INFO]MachineId: LAV9AVgtU0VCMUctcjMVNSIAbgBuADMA PID: 133 2019/05/11 10:18:36.921:[INFO]Language ID: 1033 Kernel: C:\windows\system32\ntoskrnl.exe 2019/05/11 10:18:36.921:[INFO]Host OS: Windows 7 [6.1.7601.21863] - 64-Bit - Release Client. - Process Elevated - User Fully Elevated 2019/05/11 10:18:36.921:[INFO]Exepath: c:\star wars-the old republic\bitraider\bin\brwc.exe 2019/05/11 10:18:36.921:[INFO]Command Parms: brdestpath="c:\star wars-the old republic" brlocalebank=0 id=swtor_swtor -brnolaunch -brnoui brcallingpid=8 2019/05/11 10:18:36.928:[INFO]Connecting to Service Core, command: 13 2019/05/11 10:18:36.929:[INFO]CBRWCApp: Loaded common path "c:\star wars-the old republic\Bitraider\bin" for ID=swtor_swtor 2019/05/11 10:18:36.976:[INFO]STLEFE: Skipping extract to c:\Star Wars-The Old Republic\bitraider\bin\BRException.exe; identical to reource 2019/05/11 10:18:36.979:[INFO]STLEFE: Skipping extract to C:\ProgramData\BitRaider\common\BRException.exe; identical to reource 2019/05/11 10:18:36.980:[INFO]STLEFE: Skipping extract to c:\Star Wars-The Old Republic\bitraider\bin\BRExtPipe.dll; identical to reource 2019/05/11 10:18:36.981:[INFO]STLEFE: Skipping extract to C:\ProgramData\BitRaider\BRExtPipe.dll; identical to reource 2019/05/11 10:18:37.009:[CRIT](BRDriver64_1_3_3_E02B25FC): reading 'DependOnService' string under key System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC failed. error code 0 2019/05/11 10:18:37.012:[INFO]CSTL-StartStopSupportServiceStub: CurrentState: 3 2019/05/11 10:18:38.013:[INFO]CSTL-StartStopSupportServiceStub: CurrentState: 1 2019/05/11 10:18:38.021:[INFO]STLEFE: Skipping extract to C:\ProgramData\BitRaider\BRSptStub.exe; identical to reource 2019/05/11 10:18:38.031:[INFO]Attempting to install a new copy of the service helper. 2019/05/11 10:18:38.266:[INFO]Support Service Successfully installed 2019/05/11 10:18:38.266:[CRIT](BRDriver64_1_3_3_E02B25FC): read ... --- snip ---
App creates the service registry keys prior to SCM (see bug 47175 and bug 47176) and then uses SCM API to create the service entry.
Relevant part of trace log.
--- snip --- $ pwd /home/focht/.wine/drive_c/Star Wars-The Old Republic/bitraider/bin
$ WINEDEBUG=+seh,+relay,+server,+reg,+service wine ./brwc.exe brdestpath="c:\star wars-the old republic" brlocalebank=0 id=swtor_swtor -brnolaunch -brnoui brcallingpid=8 >>log.txt 2>&1 ... 003c:Call advapi32.RegCreateKeyExW(80000002,0032f5d4 L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC",00000000,0042ab4c,00000000,0000000e,00000000,0032efd0,0032efc8) ret=0040b176 003c:trace:reg:NtCreateKey (0x24,L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC",L"",0,e,0x32ee14) 003c: create_key( access=0000000e, options=00000000, objattr={rootdir=0024,attributes=00000000,sd={},name=L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC"}, class=L"" ) 003c: create_key() = 0 { hkey=0054, created=0 } 003c:trace:reg:NtCreateKey <- 0x54 003c:Ret advapi32.RegCreateKeyExW() retval=00000000 ret=0040b176 003c:Call advapi32.RegSetValueExW(00000054,0042d644 L"DisplayName",00000000,00000001,005f2aa0,00000032) ret=0040b1b6 003c:trace:reg:NtSetValueKey (0x54,L"DisplayName",1,0x5f2aa0,52) 003c: set_key_value( hkey=0054, type=1, namelen=22, name=L"DisplayName", data={42,00,52,00,44,00,72,00,69,00,76,00,65,00,72,00,36,00,34,00,5f,00,31,00,5f,00,33,00,5f,00,33,00,5f,00,45,00,30,00,32,00,42,00,32,00,35,00,46,00,43,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b1b6 003c:Call advapi32.RegSetValueExW(00000054,0042d65c L"ErrorControl",00000000,00000004,0032efbc,00000004) ret=0040b1e2 003c:trace:reg:NtSetValueKey (0x54,L"ErrorControl",4,0x32efbc,4) 003c: set_key_value( hkey=0054, type=4, namelen=24, name=L"ErrorControl", data={01,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b1e2 003c:Call advapi32.RegSetValueExW(00000054,0042d684 L"ImagePath",00000000,00000001,0032efd4,00000084) ret=0040b26c 003c:trace:reg:NtSetValueKey (0x54,L"ImagePath",1,0x32efd4,134) 003c: set_key_value( hkey=0054, type=1, namelen=18, name=L"ImagePath", data={5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,44,00,61,00,74,00,61,00,5c,00,42,00,69,00,74,00,52,00,61,00,69,00,64,00,65,00,72,00,5c,00,73,00,75,00,70,00,70,00,6f,00,72,00,74,00,5c,00,31,00,2e,00,33,00,2e,00,33,00,5c,00,45,00,30,00,32,00,42,00,32,00,35,00,46,00,43,00,5c,00,42,00,52,00,44,00,72,00,69,00,76,00,65,00,72,00,36,00,34,00,2e,00,73,00,79,00,73,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b26c 003c:Call advapi32.RegSetValueExW(00000054,0042d698 L"Start",00000000,00000004,0032efb8,00000004) ret=0040b298 003c:trace:reg:NtSetValueKey (0x54,L"Start",4,0x32efb8,4) 003c: set_key_value( hkey=0054, type=4, namelen=10, name=L"Start", data={03,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b298 003c:Call advapi32.RegSetValueExW(00000054,0042d6a4 L"Type",00000000,00000004,0032efc0,00000004) ret=0040b2c6 003c:trace:reg:NtSetValueKey (0x54,L"Type",4,0x32efc0,4) 003c: set_key_value( hkey=0054, type=4, namelen=8, name=L"Type", data={02,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b2c6 003c:Call advapi32.RegSetValueExW(00000054,0042d6b0 L"Tag",00000000,00000004,0032efcc,00000004) ret=0040b2ee 003c:trace:reg:NtSetValueKey (0x54,L"Tag",4,0x32efcc,4) 003c: set_key_value( hkey=0054, type=4, namelen=6, name=L"Tag", data={02,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b2ee 003c:Call advapi32.RegSetValueExW(00000054,0042d6c8 L"DependOnService",00000000,00000007,0032f1d4,0000000c) ret=0040b361 003c:trace:reg:NtSetValueKey (0x54,L"DependOnService",7,0x32f1d4,14) 003c: set_key_value( hkey=0054, type=7, namelen=30, name=L"DependOnService", data={46,00,6c,00,74,00,4d,00,67,00,72,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b361 003c:Call advapi32.RegSetValueExW(00000054,0042d71c L"Group",00000000,00000007,0032f3d4,00000032) ret=0040b3db 003c:trace:reg:NtSetValueKey (0x54,L"Group",7,0x32f3d4,52) 003c: set_key_value( hkey=0054, type=7, namelen=10, name=L"Group", data={46,00,73,00,46,00,69,00,6c,00,74,00,65,00,72,00,20,00,41,00,63,00,74,00,69,00,76,00,69,00,74,00,79,00,20,00,4d,00,6f,00,6e,00,69,00,74,00,6f,00,72,00,00,00} ) 003c: set_key_value() = 0 003c:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040b3db 003c:Call advapi32.RegCloseKey(00000054) ret=0040b4be 003c: close_handle( handle=0054 ) 003c: close_handle() = 0 003c:Ret advapi32.RegCloseKey() retval=00000000 ret=0040b4be 003c:Call advapi32.RegCreateKeyExW(80000002,0032f5d4 L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC\Instances",00000000,0042ab4c,00000000,0000000e,00000000,0032efd0,0032efc8) ret=0040b504 003c:trace:reg:NtCreateKey (0x24,L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC\Instances",L"",0,e,0x32ee14) 003c: create_key( access=0000000e, options=00000000, objattr={rootdir=0024,attributes=00000000,sd={},name=L"System\CurrentControlSet\Services\BRDriver64_1_3_3_E02B25FC\Instances"}, class=L"" ) 003c: create_key() = 0 { hkey=0054, created=0 } 003c:trace:reg:NtCreateKey <- 0x54 003c:Ret advapi32.RegCreateKeyExW() retval=00000000 ret=0040b504 ... 003c:Call advapi32.CreateServiceW(0014f2a0,005f2aa0 L"BRDriver64_1_3_3_E02B25FC",005f2aa0 L"BRDriver64_1_3_3_E02B25FC",000f01ff,00000002,00000003,00000001,005f2bd8 L"C:\ProgramData\BitRaider\support\1.3.3\E02B25FC\BRDriver64.sys",00000000,00000000,00000000,00000000,00000000) ret=0040b048 003c:trace:service:CreateServiceW 0x14f2a0 L"BRDriver64_1_3_3_E02B25FC" L"BRDriver64_1_3_3_E02B25FC" ... --- snip ---
'services.exe' side:
--- snip --- ... 0014:trace:service:svcctl_CreateServiceWOW64W Call msvcrt._vsnprintf(00bbeff0,00000400,0041b0aa "(%s, %s, 0x%x, %s)\n",00bbf430) ret=00401def 0014:Ret msvcrt._vsnprintf() retval=0000008f ret=00401def (L"BRDriver64_1_3_3_E02B25FC", L"BRDriver64_1_3_3_E02B25FC", 0xf01ff, L"C:\ProgramData\BitRaider\support\1.3.3\E02B25FC\BRDriver64.sys") ... 0014:trace:service:create_serviceW Call msvcrt._vsnprintf(00bbf020,00000400,0041b0aa "(%s, %s, 0x%x, %s)\n",00bbf460) ret=00401def ... 0014:Call advapi32.RegCreateKeyW(00000024,00033d30 L"BRDriver64_1_3_3_E02B25FC",00bbf3c8) ret=004066d8 0014:trace:reg:NtCreateKey (0x24,L"BRDriver64_1_3_3_E02B25FC",(null),0,2000000,0xbbf128) 0014: create_key( access=02000000, options=00000000, objattr={rootdir=0024,attributes=00000000,sd={},name=L"BRDriver64_1_3_3_E02B25FC"}, class=L"" ) 0014: create_key() = 0 { hkey=01a0, created=0 } 0014:trace:reg:NtCreateKey <- 0x1a0 0014:Ret advapi32.RegCreateKeyW() retval=00000000 ret=004066d8 0014:Call advapi32.RegSetValueExW(000001a0,0041c670 L"DisplayName",00000000,00000001,00033e20,00000034) ret=0040655e 0014:trace:reg:NtSetValueKey (0x1a0,L"DisplayName",1,0x33e20,52) 0014: set_key_value( hkey=01a0, type=1, namelen=22, name=L"DisplayName", data={42,00,52,00,44,00,72,00,69,00,76,00,65,00,72,00,36,00,34,00,5f,00,31,00,5f,00,33,00,5f,00,33,00,5f,00,45,00,30,00,32,00,42,00,32,00,35,00,46,00,43,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040655e 0014:Call advapi32.RegSetValueExW(000001a0,0041c610 L"ImagePath",00000000,00000001,00033d80,00000086) ret=0040655e 0014:trace:reg:NtSetValueKey (0x1a0,L"ImagePath",1,0x33d80,134) 0014: set_key_value( hkey=01a0, type=1, namelen=18, name=L"ImagePath", data={5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,44,00,61,00,74,00,61,00,5c,00,42,00,69,00,74,00,52,00,61,00,69,00,64,00,65,00,72,00,5c,00,73,00,75,00,70,00,70,00,6f,00,72,00,74,00,5c,00,31,00,2e,00,33,00,2e,00,33,00,5c,00,45,00,30,00,32,00,42,00,32,00,35,00,46,00,43,00,5c,00,42,00,52,00,44,00,72,00,69,00,76,00,65,00,72,00,36,00,34,00,2e,00,73,00,79,00,73,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040655e 0014:Call advapi32.RegDeleteValueW(000001a0,0041c600 L"Group") ret=00406568 0014:trace:reg:NtDeleteValueKey (0x1a0,L"Group") 0014: delete_key_value( hkey=01a0, name=L"Group" ) 0014: delete_key_value() = 0 0014:Ret advapi32.RegDeleteValueW() retval=00000000 ret=00406568 0014:Call advapi32.RegSetValueExW(000001a0,0041c590 L"ObjectName",00000000,00000001,00034770,00000018) ret=0040655e 0014:trace:reg:NtSetValueKey (0x1a0,L"ObjectName",1,0x34770,24) 0014: set_key_value( hkey=01a0, type=1, namelen=20, name=L"ObjectName", data={4c,00,6f,00,63,00,61,00,6c,00,53,00,79,00,73,00,74,00,65,00,6d,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040655e 0014:Call advapi32.RegDeleteValueW(000001a0,0041c570 L"Description") ret=00406568 0014:trace:reg:NtDeleteValueKey (0x1a0,L"Description") 0014: delete_key_value( hkey=01a0, name=L"Description" ) 0014: delete_key_value() = OBJECT_NAME_NOT_FOUND 0014:Ret advapi32.RegDeleteValueW() retval=00000002 ret=00406568 0014:Call advapi32.RegDeleteValueW(000001a0,0041c5e0 L"DependOnService") ret=0040622f 0014:trace:reg:NtDeleteValueKey (0x1a0,L"DependOnService") 0014: delete_key_value( hkey=01a0, name=L"DependOnService" ) 0014: delete_key_value() = 0 0014:Ret advapi32.RegDeleteValueW() retval=00000000 ret=0040622f 0014:Call advapi32.RegDeleteValueW(000001a0,0041c5b0 L"DependOnGroup") ret=0040622f 0014:trace:reg:NtDeleteValueKey (0x1a0,L"DependOnGroup") 0014: delete_key_value( hkey=01a0, name=L"DependOnGroup" ) 0014: delete_key_value() = OBJECT_NAME_NOT_FOUND 0014:Ret advapi32.RegDeleteValueW() retval=00000002 ret=0040622f 0014:Call advapi32.RegSetValueExW(000001a0,0041c650 L"Start",00000000,00000004,00033c94,00000004) ret=004067f9 0014:trace:reg:NtSetValueKey (0x1a0,L"Start",4,0x33c94,4) 0014: set_key_value( hkey=01a0, type=4, namelen=10, name=L"Start", data={03,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=004067f9 0014:Call advapi32.RegSetValueExW(000001a0,0041c630 L"ErrorControl",00000000,00000004,00033c98,00000004) ret=0040682e 0014:trace:reg:NtSetValueKey (0x1a0,L"ErrorControl",4,0x33c98,4) 0014: set_key_value( hkey=01a0, type=4, namelen=24, name=L"ErrorControl", data={01,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040682e 0014:Call advapi32.RegSetValueExW(000001a0,0041c660 L"Type",00000000,00000004,00033c90,00000004) ret=00406863 0014:trace:reg:NtSetValueKey (0x1a0,L"Type",4,0x33c90,4) 0014: set_key_value( hkey=01a0, type=4, namelen=8, name=L"Type", data={02,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=00406863 0014:Call advapi32.RegSetValueExW(000001a0,0041c540 L"PreshutdownTimeout",00000000,00000004,00033cd0,00000004) ret=0040689b 0014:trace:reg:NtSetValueKey (0x1a0,L"PreshutdownTimeout",4,0x33cd0,4) 0014: set_key_value( hkey=01a0, type=4, namelen=36, name=L"PreshutdownTimeout", data={20,bf,02,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040689b 0014:Call advapi32.RegSetValueExW(000001a0,0041c540 L"PreshutdownTimeout",00000000,00000004,00033cd0,00000004) ret=004068cc 0014:trace:reg:NtSetValueKey (0x1a0,L"PreshutdownTimeout",4,0x33cd0,4) 0014: set_key_value( hkey=01a0, type=4, namelen=36, name=L"PreshutdownTimeout", data={20,bf,02,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=004068cc 0014:Call advapi32.RegSetValueExW(000001a0,0041c518 L"WOW64",00000000,00000004,00bbf3c4,00000004) ret=0040694c 0014:trace:reg:NtSetValueKey (0x1a0,L"WOW64",4,0xbbf3c4,4) 0014: set_key_value( hkey=01a0, type=4, namelen=10, name=L"WOW64", data={01,00,00,00} ) 0014: set_key_value() = 0 0014:Ret advapi32.RegSetValueExW() retval=00000000 ret=0040694c 0014:Call advapi32.RegDeleteValueW(000001a0,0041c588 L"Tag") ret=00406969 0014:trace:reg:NtDeleteValueKey (0x1a0,L"Tag") 0014: delete_key_value( hkey=01a0, name=L"Tag" ) 0014: delete_key_value() = 0 0014:Ret advapi32.RegDeleteValueW() retval=00000000 ret=00406969 0014:Call advapi32.RegCloseKey(000001a0) ret=004066e8 0014: close_handle( handle=01a0 ) 0014: close_handle() = 0 0014:Ret advapi32.RegCloseKey() retval=00000000 ret=004066e8 --- snip ---
The app passes NULL 'lpDependencies' in call to 'advapi32.CreateServiceW' hence Wine deletes the registry data for 'DependOnService'. This leads to validation failure leading, causing another instance of infamous "Installation of the driver and support components require administrative permission acknowledgment. Try invoking the client again. nInstaller cannot continue. Exiting." message.
Microsoft documentation:
https://docs.microsoft.com/en-us/windows/desktop/api/winsvc/nf-winsvc-create...
--- quote --- lpDependencies
A pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service. Specify NULL or an empty string if the service has no dependencies. Dependency on a group means that this service can run if at least one member of the group is running after an attempt to start all members of the group.
You must prefix group names with SC_GROUP_IDENTIFIER so that they can be distinguished from a service name, because services and service groups share the same name space. --- quote ---
"Specify NULL or an empty string if the service has no dependencies." apparently the documentation is not accurate if Windows SCM keeps the existing data.
Wine source:
https://source.winehq.org/git/wine.git/blob/HEAD:/programs/services/services...
--- snip --- 204 static DWORD reg_set_string_value(HKEY hKey, LPCWSTR value_name, LPCWSTR string) 205 { 206 if (!string) 207 { 208 DWORD err; 209 err = RegDeleteValueW(hKey, value_name); 210 if (err != ERROR_FILE_NOT_FOUND) 211 return err; 212 213 return ERROR_SUCCESS; 214 } 215 216 return RegSetValueExW(hKey, value_name, 0, REG_SZ, (const BYTE*)string, sizeof(WCHAR)*(lstrlenW(string) + 1)); 217 } --- snip ---
$ sha1sum SWTOR_setup.exe c538935eff4ec90ce2e48dc7e515a8dec2f15f58 SWTOR_setup.exe
$ du -sh SWTOR_setup.exe 32M SWTOR_setup.exe
$ wine --version wine-4.8
Regards
https://bugs.winehq.org/show_bug.cgi?id=47186
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |https://web.archive.org/web | |/20190505203021/http://patc | |hnotes.swtor.com/SWTOR_setu | |p.exe
https://bugs.winehq.org/show_bug.cgi?id=47186
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Star Wars - The Old |BitRaider Streaming Client |Republic (SWTOR) |1.3.3 fails with |client/launcher fails with |'Installation of drivers |'Installation of drivers |require administrative |require admin permission' |permission' (existing |(BitRaider)(existing |service dependencies must |service dependencies must |be preserved by SCM when |be preserved by SCM when |passed NULL) |passed NULL) |
--- Comment #1 from Anastasius Focht focht@gmx.net --- Hello folks,
refining ticket summary to be generic about BitRaider to collect dupes and cover all games using this content distribution technology.
Regards