clementgallet / libTAS

GNU/Linux software to (hopefully) give TAS tools to games
GNU General Public License v3.0
494 stars 56 forks source link

New versions of Wine (Possibly post-6.0) are incompatible. #401

Open ChrisNonyminus opened 3 years ago

ChrisNonyminus commented 3 years ago

vcxsrv_YDrs1OLaKV When trying to launch The Sims 2 through wine-staging through libTAS, this happens.

qixils commented 3 years ago

Did The Sims 2 work on older versions of wine in libTAS? Does the game run fine in wine outside of libTAS?

ChrisNonyminus commented 3 years ago

It runs fine in wine outside of libTAS. The only wine version where The Sims 2 runs is wine-staging, which isn't compatible with libTAS.

clementgallet commented 3 years ago

I confirm it works in 5.0 but not in 6.0. The first thing I noticed is that they appear to split each library code into two files: a native library (.so) containing Unix-only code, and a .dll.so version containing the Windows API functions?

So, libTAS does not recognize anymore loading ntdll.dll.so, but it shouldn't be an issue.

The 5.9 changelog shows that there was a big change in the process loading, with more code inside ntdll.so, which is loaded earlier apparently?

clementgallet commented 3 years ago

Using WINEDEBUG=+module,+x11drv, here is the mismatch between the logs with/without libTAS, starting just after the initialization of the winex11 driver. There was no mismatch in logs during that init, but one thing I'm concerned is that some functions should be hooked during the driver init, but I don't see anything in the log. It could be because the driver loading was not done in a conventional way (dlopen()), but seems to be hardcoded.

Native:

006c:trace:module:MODULE_InitDLL (00007F875DD20000,PROCESS_ATTACH,0000000000000000) - RETURN 1
006c:trace:module:process_attach (L"winex11.drv",0000000000000000) - END
006c:trace:module:GetModuleFileNameW L"C:\\windows\\system32\\winex11.drv"
006c:trace:module:LdrGetDllHandle L"ntdll.dll" -> 000000007BC00000 (load path L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem")
006c:trace:module:load_dll looking for L"C:\\windows\\system32\\winex11.drv" in L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem"
006c:trace:module:load_dll Found L"C:\\windows\\system32\\winex11.drv" for L"C:\\windows\\system32\\winex11.drv" at 00007F875DD20000, count=2
006c:trace:module:LdrAddRefDll (L"winex11.drv") ldr.LoadCount: 3
006c:trace:module:load_dll looking for L"user32.dll" in L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem"
006c:trace:module:load_dll Found L"C:\\windows\\system32\\user32.dll" for L"user32.dll" at 000000006EB00000, count=-1
006c:trace:module:LdrGetDllHandle L"user32.dll" -> 000000006EB00000 (load path L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem")
006c:trace:module:LdrGetDllHandle L"ntdll.dll" -> 000000007BC00000 (load path L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem")
006c:trace:module:FindResourceExW 000000006EB00000 #000c #7f00 0000
006c:trace:module:LoadResource 000000006EB00000 000000006EC3F4B0
...

And with libTAS:

0074:trace:module:MODULE_InitDLL (00007FF3558B0000,PROCESS_ATTACH,0000000000000000) - RETURN 1
0074:trace:module:process_attach (L"winex11.drv",0000000000000000) - END
0074:trace:module:GetModuleFileNameW L"C:\\windows\\system32\\winex11.drv"
0074:trace:module:load_dll looking for L"user32.dll" in L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem"
0074:trace:module:load_dll Found L"C:\\windows\\system32\\user32.dll" for L"user32.dll" at 000000006EB00000, count=-1
0074:trace:module:LdrGetDllHandle L"user32.dll" -> 000000006EB00000 (load path L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem")
0074:trace:module:LdrGetDllHandle L"ntdll.dll" -> 000000007BC00000 (load path L"C:\\windows\\system32;C:\\windows\\system32;C:\\windows\\system;C:\\windows;.;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem")
0074:trace:module:FindResourceExW 000000006EB00000 #000c #7f00 0000
0074:trace:module:LoadResource 000000006EB00000 000000006EC3F4B0
clementgallet commented 3 years ago

Issue appears between 5.5 and 5.6 (tested with debian wine-devel packages from winehq official repo).