https://bugs.winehq.org/show_bug.cgi?id=50323
Bug ID: 50323 Summary: Multiple applications need 'winsock.getservbyname' to read information from '%SystemRoot%\System32\Drivers\Etc\services' (Autodesk 3ds Max 9 RaySat service) Product: Wine Version: 6.0-rc2 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
follow-up to bug 12076
Autodesk 3ds Max 9 installation will fail when 'SAT service' option is selected. The service is also mentioned in bug 32317.
--- snip --- $ WINEDEBUG=+seh,+loaddll,+relay,+services,+msi wine msiexec -i 3dsmax9_win32.msi >>log.txt 2>&1 ... 0024:trace:msi:ACTION_PerformAction Performing action (L"StartServices") ... 0124:Call KERNEL32.CreateProcessW(00000000,00126b70 L"C:\Program Files\Autodesk\3ds Max 9\mentalray\satellite\raysat_3dsmax9_32server.exe",00000000,00000000,00000000,00000400,0012f5f0,00000000,0121f9d8,0121fbec) ret=00406247 ... 0144:trace:loaddll:build_module Loaded L"C:\windows\system32\ntdll.dll" at 7BC00000: builtin 0144:trace:loaddll:build_module Loaded L"C:\windows\system32\kernelbase.dll" at 7B000000: builtin 0144:trace:loaddll:build_module Loaded L"C:\windows\system32\kernel32.dll" at 7B600000: builtin 0144:trace:loaddll:build_module Loaded L"C:\Program Files\Autodesk\3ds Max 9\mentalray\satellite\raysat_3dsmax9_32server.exe" at 00400000: native ... 0124:Ret KERNEL32.CreateProcessW() retval=00000001 ret=00406247 ... 01c4:Call advapi32.SetServiceStatus(00127df8,0040f380) ret=004028c3 ... 01c4:Ret advapi32.SetServiceStatus() retval=00000001 ret=004028c3 01c4:Call ws2_32.getservbyname(00cbf9e0 "mi-raysat_3dsmax9_32",0040bad4 "tcp") ret=004028fa ... 01c4:Ret ws2_32.getservbyname() retval=00000000 ret=004028fa 01c4:Call KERNEL32.GetLastError() ret=0040130c 01c4:Ret KERNEL32.GetLastError() retval=00002afc ret=0040130c 01c4:Call KERNEL32.GetLastError() ret=004011dd 01c4:Ret KERNEL32.GetLastError() retval=00002afc ret=004011dd 01c4:Call KERNEL32.FormatMessageA(00003100,00000000,00002afc,00000000,00cbf344,00000000,00000000) ret=004011eb 01c4:Call ntdll.RtlFindMessage(7b600000,0000000b,00000000,00002afc,00cbf290) ret=7b023ef5 01c4:Ret ntdll.RtlFindMessage() retval=c0000109 ret=7b023ef5 01c4:Call ntdll.RtlNtStatusToDosError(c0000109) ret=7b023f00 01c4:Ret ntdll.RtlNtStatusToDosError() retval=0000013d ret=7b023f00 01c4:Ret KERNEL32.FormatMessageA() retval=00000000 ret=004011eb 01c4:Call advapi32.RegisterEventSourceA(00000000,0040f260 "RaySat_3dsmax9_32 Server") ret=0040111e 01c4:fixme:advapi:RegisterEventSourceA ((null),"RaySat_3dsmax9_32 Server"): stub 01c4:fixme:advapi:RegisterEventSourceW (L"",L"RaySat_3dsmax9_32 Server"): stub 01c4:Ret advapi32.RegisterEventSourceA() retval=cafe4242 ret=0040111e 01c4:Call advapi32.ReportEventA(cafe4242,00000001,00000000,c0020002,00000000,00000002,00000000,00cbf364,00000000) ret=0040116b 01c4:fixme:advapi:ReportEventA (CAFE4242,0x0001,0x0000,0xc0020002,00000000,0x0002,0x00000000,00CBF364,00000000): stub 01c4:fixme:advapi:ReportEventW (CAFE4242,0x0001,0x0000,0xc0020002,00000000,0x0002,0x00000000,00128080,00000000): stub 01c4:err:eventlog:ReportEventW L"(1632) getservbyname: 0x2afc (11004)" 01c4:err:eventlog:ReportEventW L"" 01c4:Ret advapi32.ReportEventA() retval=00000001 ret=0040116b 01c4:Call advapi32.DeregisterEventSource(cafe4242) ret=004011ad 01c4:fixme:advapi:DeregisterEventSource (CAFE4242) stub 01c4:Ret advapi32.DeregisterEventSource() retval=00000001 ret=004011ad 01c4:Call advapi32.SetServiceStatus(00127df8,0040f380) ret=00402c28 ... 01c4:Ret advapi32.SetServiceStatus() retval=00000001 ret=00402c28 ... 0144:Call KERNEL32.ExitProcess(00000000) ret=00403a8a ... 0024:warn:msi:ITERATE_StartService service failed to start 1 ... 0024:trace:msi:msi_schedule_action Scheduling action L"StopServices" in script 2 ... 0024:err:msi:execute_script Execution of script 0 halted; action L"StartServices" returned 1627 ... 0024:err:msi:ITERATE_Actions Execution halted, action L"InstallFinalize" returned 1627 ... --- snip ---
The following entry is written to '%SystemRoot%\System32\Drivers\Etc\services' file during service installation:
--- snip --- ... mi-raysat_3dsmax9_32 7504/tcp #mental ray 3.5 Satellite (32-bit) --- snip ---
The service tries to retrieve its own service information (port) using winsock 'getservbyname' function. This obviously fails because Wine calls Linux libc function which is by design unaware of '%SystemRoot%\System32\Drivers\Etc\services'.
Wine source:
https://source.winehq.org/git/wine.git/blob/3acb0b3326c4120ea0c4c6076bd03c9c...
--- snip --- 6386 /*********************************************************************** 6387 * getservbyname (WS2_32.55) 6388 */ 6389 struct WS_servent* WINAPI WS_getservbyname(const char *name, const char *proto) 6390 { 6391 struct WS_servent* retval = NULL; 6392 struct servent* serv; 6393 char *name_str; 6394 char *proto_str = NULL; 6395 6396 if (!(name_str = strdup_lower(name))) return NULL; 6397 6398 if (proto && *proto) 6399 { 6400 if (!(proto_str = strdup_lower(proto))) 6401 { 6402 HeapFree( GetProcessHeap(), 0, name_str ); 6403 return NULL; 6404 } 6405 } 6406 6407 EnterCriticalSection( &csWSgetXXXbyYYY ); 6408 serv = getservbyname(name_str, proto_str); 6409 if( serv != NULL ) 6410 { 6411 retval = WS_dup_se(serv); 6412 } 6413 else SetLastError(WSANO_DATA); 6414 LeaveCriticalSection( &csWSgetXXXbyYYY ); 6415 HeapFree( GetProcessHeap(), 0, proto_str ); 6416 HeapFree( GetProcessHeap(), 0, name_str ); 6417 TRACE( "%s, %s ret %p\n", debugstr_a(name), debugstr_a(proto), retval ); 6418 return retval; 6419 } --- snip ---
$ sha1sum 3dsmax9.zip d04eeb0eeabbb7cedaf536170fb6879b2faf1a25 3dsmax9.zip
$ du -sh 3dsmax9.zip 590M 3dsmax9.zip
$ wine --version wine-6.0-rc2
Regards