https://bugs.winehq.org/show_bug.cgi?id=38513
Bug ID: 38513 Summary: Unimplemented function GetSystemTimePreciseAsFileTime Product: Wine Version: 1.7.38 Hardware: x86-64 URL: http://www.winuae.net/files/b/winuae_test.zip OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: markk@clara.co.uk Distribution: ---
I noticed a problem running the latest pre-beta version of WinUAE in Wine 1.7.38.
On running winuae.exe, Wine reports this (repeated many times): wine: Call from 0x7b83b6ae to unimplemented function api-ms-win-core-sysinfo-l1-2-1.dll.GetSystemTimePreciseAsFileTime, aborting and eventually: err:seh:setup_exception_record stack overflow 1072 bytes in thread 0009 eip f73a3061 esp 053e0f00 stack 0x53e0000-0x53e1000-0x5660000
GetSystemTimePreciseAsFileTime is Windows 8+ only. This bug isn't to report that GetSystemTimePreciseAsFileTime is unimplemented (though that's true). The problem is that winuae.exe tries to call it even when Wine is set to Windows XP mode.
On native Windows winuae.exe only calls it when running on Windows 8+; the program works fine on native Windows XP, Windows Vista 32-bit and Windows 7 32-bit.
The problem could be related to Visual Studio 2015 RC. The developer said:
'Probably any msvc 2015 rc compiled program has same problem, I guess.. Platform Toolset is set to "Visual Studio 2015 - Windows XP (v140_xp)" (plain v140 drops XP support)'
To reproduce: - Download the WinUAE 3.0.0 installer from http://www.winuae.net/files/InstallWinUAE3000.msi or the zip archive from http://www.winuae.net/files/WinUAE3000.zip - Run the installer or unpack the zip archive. - Download the pre-beta executable from http://www.winuae.net/files/b/winuae_test.zip - Replace the v3.0.0 winuae.exe with that version. - Run winuae.exe
https://bugs.winehq.org/show_bug.cgi?id=38513
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |kernel32
https://bugs.winehq.org/show_bug.cgi?id=38513
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=38513
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |c9c5ceccb4f50a81a0f99d683a4 | |6dc1f5d4ede62 Status|UNCONFIRMED |RESOLVED CC| |sebastian@fds-team.de Resolution|--- |FIXED
--- Comment #1 from Sebastian Lackner sebastian@fds-team.de --- Fixed by http://source.winehq.org/git/wine.git/commit/c9c5ceccb4f50a81a0f99d683a46dc1....
Could you please retest? If there are any remaining issues (for example other missing exports) please open a new bug report.
https://bugs.winehq.org/show_bug.cgi?id=38513
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Unimplemented function |Winuae crashes on |GetSystemTimePreciseAsFileT |unimplemented function |ime |GetSystemTimePreciseAsFileT | |ime
https://bugs.winehq.org/show_bug.cgi?id=38513
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.44.
https://bugs.winehq.org/show_bug.cgi?id=38513
Mark K markk@clara.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |markk@clara.co.uk
--- Comment #3 from Mark K markk@clara.co.uk --- The ubuntu-wine PPA version of Wine is still stuck at 1.7.38; I'll test if/when that ever gets updated.
But isn't the real problem here that even when Wine is set to XP mode, a program can open/call functions in api-ms-win-core-sysinfo-l1-2-1.dll, whereas on a real Windows XP system that DLL is not available?
https://bugs.winehq.org/show_bug.cgi?id=38513
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello Mark,
--- quote --- But isn't the real problem here that even when Wine is set to XP mode, a program can open/call functions in api-ms-win-core-sysinfo-l1-2-1.dll, whereas on a real Windows XP system that DLL is not available? --- quote ---
Since MS messed this up by referencing non-XP API with 'v140_xp' platform profile, the app would simply fail on Windows XP but still run with Wine 1.7.44+. Usually people report bugs because they want to get their apps/games working with Wine. You want to have Wine changed to behave exactly as Windows, preventing the app to run on default Windows XP profile? That's kind of unusual request :-)
Wine doesn't provide different sets of binaries per Windows version nor hides API at runtime (with a few exceptions) to mimic API sets. It's a design decision that usually works out well with the exception of some brain damaged apps.
Regards
https://bugs.winehq.org/show_bug.cgi?id=38513
--- Comment #5 from Mark K markk@clara.co.uk --- As I mentioned in the initial bug report though, this specific WinUAE executable *does work* on native Windows XP.
Perhaps there is some bug/interaction with the way the Visual Studio 2015 startup code detects whether it's running under XP?
https://bugs.winehq.org/show_bug.cgi?id=38513
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello Mark,
--- quote --- As I mentioned in the initial bug report though, this specific WinUAE executable *does work* on native Windows XP.
Perhaps there is some bug/interaction with the way the Visual Studio 2015 startup code detects whether it's running under XP? --- quote ---
Ok, I missed that part that it works on Windows XP.
The trace log shows this:
--- snip --- 0009:Starting process L"Z:\home\focht\Downloads\winuae.exe" (entryproc=0xb9684a) 0009:Call KERNEL32.GetSystemTimeAsFileTime(0565fe20) ret=00b96ccc 0009:Ret KERNEL32.GetSystemTimeAsFileTime() retval=0565fe20 ret=00b96ccc 0009:Call KERNEL32.QueryPerformanceCounter(0565fe18) ret=00b96cf1 0009:Ret KERNEL32.QueryPerformanceCounter() retval=00000001 ret=00b96cf1 0009:Call KERNEL32.IsProcessorFeaturePresent(0000000a) ret=00b96883 0009:Ret KERNEL32.IsProcessorFeaturePresent() retval=00000001 ret=00b96883 0009:Call KERNEL32.LoadLibraryExW(00cb16e4 L"api-ms-win-core-synch-l1-2-0",00000000,00000800) ret=00b9a68a 0009:fixme:module:load_library unsupported flag(s) used (flags: 0x00000800) 0009:Call PE DLL (proc=0xf75ad8b4,module=0xf75a0000 L"api-ms-win-core-synch-l1-2-0.dl",reason=PROCESS_ATTACH,res=(nil)) 0009:Call KERNEL32.DisableThreadLibraryCalls(f75a0000) ret=f75ad967 0009:Ret KERNEL32.DisableThreadLibraryCalls() retval=00000001 ret=f75ad967 0009:Ret PE DLL (proc=0xf75ad8b4,module=0xf75a0000 L"api-ms-win-core-synch-l1-2-0.dl",reason=PROCESS_ATTACH,res=(nil)) retval=1 0009:Ret KERNEL32.LoadLibraryExW() retval=f75a0000 ret=00b9a68a 0009:Call KERNEL32.GetProcAddress(f75a0000,00cb17cc "InitializeCriticalSectionEx") ret=00b9a616 0009:Ret KERNEL32.GetProcAddress() retval=7b82f4a4 ret=00b9a616 0009:Call KERNEL32.InitializeCriticalSectionEx(0524b428,00000fa0,00000000) ret=00b9a8f3 0009:Ret KERNEL32.InitializeCriticalSectionEx() retval=00000001 ret=00b9a8f3 --- snip ---
'InitializeCriticalSectionEx' is a good example since it's also not present on Windows XP (Vista+ API).
The app tries to late-bind this API through 'api-ms-win-core-synch-l1-2-0' Windows API Set. Since Wine provides this Windows API Set with recent versions, the corresponding dll gets loaded and the import is successfully resolved (forwarder).
If the API Set dll doesn't exist ('LoadLibraryExW' failure), next try is 'kernel32.dll'.
If it can't resolve 'InitializeCriticalSectionEx' with 'kernel32.dll', the app assumes this must be Windows XP and uses another code path to switch over to an alternate implementation of the runtime feature which makes use of 'InitializeCriticalSectionAndSpinCount' which is available for Windows XP.
The same mechanism applies for the 'GetSystemTimePreciseAsFileTime' import this bug is about. The app late-binds 'GetSystemTimePreciseAsFileTime' via Windows API set dll which succeeds since it doesn't know about Wine's special auto-generated stubs. It's happy as long as 'GetProcAddress' returns something non-zero.
--- snip --- ... 0009:Call PE DLL (proc=0xf703b804,module=0xf7030000 L"api-ms-win-core-sysinfo-l1-2-1.",reason=PROCESS_ATTACH,res=(nil)) 0009:Call KERNEL32.DisableThreadLibraryCalls(f7030000) ret=f703b8b7 0009:Ret KERNEL32.DisableThreadLibraryCalls() retval=00000001 ret=f703b8b7 0009:Ret PE DLL (proc=0xf703b804,module=0xf7030000 L"api-ms-win-core-sysinfo-l1-2-1.",reason=PROCESS_ATTACH,res=(nil)) retval=1 0009:Ret KERNEL32.LoadLibraryExW() retval=f7030000 ret=00bc20b3 0009:Call KERNEL32.GetProcAddress(f7030000,00cb41e8 "GetSystemTimePreciseAsFileTime") ret=00bc2045 0009:Ret KERNEL32.GetProcAddress() retval=7b82ec34 ret=00bc2045 0009:Call KERNEL32.GetSystemTimePreciseAsFileTime(0565ed68) ret=00bc24a9 0009:Ret KERNEL32.GetSystemTimePreciseAsFileTime() retval=0565ed68 ret=00bc24a9 --- snip ---
If you fake dll load failure, the app would simply fall back to 'GetSystemTimeAsFile' which is available on Windows XP.
Regards
https://bugs.winehq.org/show_bug.cgi?id=38513
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yr.roberge@icloud.com
--- Comment #7 from Nikolay Sivov bunglehead@gmail.com --- *** Bug 39883 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38513
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pherms@outlook.com
--- Comment #8 from Austin English austinenglish@gmail.com --- *** Bug 40235 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38513
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |beraugre@gmail.com
--- Comment #9 from Nikolay Sivov bunglehead@gmail.com --- *** Bug 40632 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38513
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fahriulucaycy@gmail.com
--- Comment #10 from Bruno Jesus 00cpxxx@gmail.com --- *** Bug 41904 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38513
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |penningtonbrittney@live.com
--- Comment #11 from Austin English austinenglish@gmail.com --- *** Bug 45153 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=38513
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mikerunswim@gmail.com
--- Comment #12 from Matteo Bruni matteo.mystral@gmail.com --- *** Bug 45352 has been marked as a duplicate of this bug. ***