https://bugs.winehq.org/show_bug.cgi?id=46101
Bug ID: 46101 Summary: Multiple ARM64 apps from Windows 10 SDK (10.0.17763.x) crash on unimplemented function api-ms-win-core-libraryloader-l1-2-1.dll.GetModuleHand leW Product: Wine Version: 3.19 Hardware: aarch64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: api-ms-win-* Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
as it says.
--- snip --- $ pwd /home/focht/projects/woa-winrt/win10sdk-install/Windows Kits/10/bin/10.0.17763.0/arm64
$ WINEDEBUG=+seh,+loaddll,+process wine64 ./DeployUtil.exe ... wine: Call from 0x7bcd0024 to unimplemented function api-ms-win-core-libraryloader-l1-2-1.dll.GetModuleHandleW, aborting 0009:trace:seh:call_stack_handlers calling handler at 0x7b4d6330 code=80000100 flags=1 wine: Unimplemented function api-ms-win-core-libraryloader-l1-2-1.dll.GetModuleHandleW called at address 0x7bcd0024 (thread 0009), starting debugger... Threads: process tid prio (all id:s are in hex) 00000008 (D) Z:\home\focht\projects\woa-winrt\win10sdk-install\Windows Kits\10\bin\10.0.17763.0\arm64\DeployUtil.exe 00000009 0 <== ... System information: Wine build: wine-3.19-149-g0dd6105d23 Platform: arm64 Version: Windows 8.1 Host system: Linux Host version: 4.14.67-yocto-standard --- snip ---
Wine source:
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/api-ms-win-core-libra...
--- snip --- 1 @ stdcall FindResourceW(long wstr wstr) kernel32.FindResourceW 2 @ stdcall LoadLibraryA(str) kernel32.LoadLibraryA 3 @ stdcall LoadLibraryW(wstr) kernel32.LoadLibraryW --- snip ---
Microsoft docs:
https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-...
Even in the 1.2.0 APIset is has a lot more functions listed than Wine's .spec file. I wonder what Windows 10/SDK version was used to generate these spec files. Unfortunately that information is rarely given in the patch description. I've already complained about that poor traceability in the past.
Regards
https://bugs.winehq.org/show_bug.cgi?id=46101
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://software-download.m | |icrosoft.com/download/pr/17 | |763.1.180914-1434.rs5_relea | |se_WindowsSDK.iso Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=46101
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |andrey.goosev@gmail.com, | |martin@martin.st, | |nerv@dawncrow.de
--- Comment #1 from André H. nerv@dawncrow.de --- CCing Andrey Gusev and Martin Storsjo
https://bugs.winehq.org/show_bug.cgi?id=46101
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #2 from Fabian Maurer dark.shadow4@web.de --- Wait, those specs are generated? I always added the stubs by hand and then let make_specfiles run.
I could send in a patch to add all the missing functions though, if that's all that matters.
https://bugs.winehq.org/show_bug.cgi?id=46101
--- Comment #3 from André H. nerv@dawncrow.de --- (In reply to Fabian Maurer from comment #2)
Wait, those specs are generated? I always added the stubs by hand and then let make_specfiles run.
One way is to use winedump, e.g.: winedump spec api-nonsense.dll
https://bugs.winehq.org/show_bug.cgi?id=46101
--- Comment #4 from Martin Storsjö martin@martin.st --- (In reply to Anastasius Focht from comment #0)
Even in the 1.2.0 APIset is has a lot more functions listed than Wine's .spec file. I wonder what Windows 10/SDK version was used to generate these spec files. Unfortunately that information is rarely given in the patch description. I've already complained about that poor traceability in the past.
Sorry, I don't remember exactly which version I generated this one from. I remember digging up these api-ms-win-core-*.dll from the system32 directory of some version of Windows, but in recent Windows 10, they are no such actual files there to inspect.
Alternatively, if it was generated from the SDK, it would certainly have been incomplete as the SDK would only have the function in one apiset DLL even though it exists in many.
I'll try to document it better in the future if I add more of these api sets DLLs.
https://bugs.winehq.org/show_bug.cgi?id=46101
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com Status|NEW |RESOLVED Fixed by SHA1| |d36063d6a4222a10247522ac805 | |fc119f08edd3e Resolution|--- |FIXED
--- Comment #5 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=d36063d6a4222a10247522ac8...
https://bugs.winehq.org/show_bug.cgi?id=46101
--- Comment #6 from Martin Storsjö martin@martin.st --- (In reply to Alistair Leslie-Hughes from comment #5)
Fixed by https://source.winehq.org/git/wine.git/?a=commit; h=d36063d6a4222a10247522ac805fc119f08edd3e
What happened to the FindResourceW function in this commit?
When looking at the import libraries from Win SDK 10.0.17763.0, the mincore.lib and onecore_apiset.lib files (at least arm64 and x64, I didn't check the others) contain references to this function in api-ms-win-core-libraryloader-l1-2-1.dll, so if linking against any of these import libraries, you'll end up needing this function in exactly this apiset DLL. (It doesn't seem to be listed on the Microsoft Docs page over all APIs present in all Windows 10 versions however.)
https://bugs.winehq.org/show_bug.cgi?id=46101
--- Comment #7 from Anastasius Focht focht@gmx.net --- Hello folks,
thanks, the app runs now.
--- snip --- $ pwd /home/focht/projects/woa-winrt/win10sdk-install/Windows Kits/10/bin/10.0.17763.0/arm64
$ WINEDEBUG=+seh,+loaddll,+process wine64 ./DeployUtil.exe ... 0009:trace:loaddll:load_native_dll Loaded L"Z:\home\focht\projects\woa-winrt\win10sdk-install\Windows Kits\10\bin\10.0.17763.0\arm64\DeployUtil.exe" at 0x140000000: native 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\msvcrt.dll" at 0x7f8fa20000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-file-l1-2-2.dll" at 0x7f8f8e0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-errorhandling-l1-1-3.dll" at 0x7f8f8c0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-winrt-l1-1-0.dll" at 0x7f8f8a0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\advapi32.dll" at 0x7f8f7d0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\gdi32.dll" at 0x7f8f190000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\version.dll" at 0x7f8f150000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\user32.dll" at 0x7f8f360000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\rpcrt4.dll" at 0x7f8f0a0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\ole32.dll" at 0x7f8f610000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\combase.dll" at 0x7f8f870000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-com-l1-1-1.dll" at 0x7f8f070000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-winrt-string-l1-1-1.dll" at 0x7f8f050000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\oleaut32.dll" at 0x7f8eeb0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-handle-l1-1-0.dll" at 0x7f8ee70000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-synch-l1-2-1.dll" at 0x7f8ee50000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-winrt-error-l1-1-1.dll" at 0x7f8ee30000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-libraryloader-l1-2-1.dll" at 0x7f8ee00000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-rtlsupport-l1-2-0.dll" at 0x7f8ede0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\api-ms-win-core-processthreads-l1-1-3.dll" at 0x7f8edc0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\shlwapi.dll" at 0x7f8e240000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\shell32.dll" at 0x7f8e2e0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\mpr.dll" at 0x7f8e130000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\ws2_32.dll" at 0x7f8e0e0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\wininet.dll" at 0x7f8e190000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\urlmon.dll" at 0x7f8ecf0000: builtin 0009:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\imm32.dll" at 0x7f8df10000: builtin 0009:trace:process:NtQueryInformationProcess (0xffffffffffffffff,0x0000000c,0x22e378,0x00000004,(nil)) ... --- snip ---
@Martin
--- quote --- When looking at the import libraries from Win SDK 10.0.17763.0, the mincore.lib and onecore_apiset.lib files (at least arm64 and x64, I didn't check the others) contain references to this function in api-ms-win-core-libraryloader-l1-2-1.dll, so if linking against any of these import libraries, you'll end up needing this function in exactly this apiset DLL. (It doesn't seem to be listed on the Microsoft Docs page over all APIs present in all Windows 10 versions however.) --- quote ---
Indeed the info there is kinda inconsistent:
https://docs.microsoft.com/en-us/windows/desktop/apiindex/umbrella-lib-oneco...
Dumping the relevant import descriptor across all Win10 SDK import libs:
--- snip --- $ pwd /home/focht/projects/woa-winrt/win10sdk-install/Windows Kits/10
$ grep -ralZ FindResourceW --include *.lib | xargs -r0i bash -c "echo "{}" && winedump -j import "{}" | egrep (" : FindResourceW"|"__imp_FindResourceW") -B6 -A4"
Lib/10.0.17763.0/um/x64/mincore.lib eb3b6 SizeofResource eb3b6 __imp_SizeofResource eb43e __IMPORT_DESCRIPTOR_api-ms-win-core-libraryloader-l1-2-1 eb6f4 __NULL_IMPORT_DESCRIPTOR eb866 api-ms-win-core-libraryloader-l1-2-1_NULL_THUNK_DATA eba10 FindResourceW eba10 __imp_FindResourceW eba98 LoadLibraryA eba98 __imp_LoadLibraryA ebb1e LoadLibraryW ebb1e __imp_LoadLibraryW -- 941 __imp_FindNextFileA 98b __imp_FindNextFileNameW 942 __imp_FindNextFileW 98c __imp_FindNextStreamW 943 __imp_FindNextVolumeW 9e6 __imp_FindResourceExW 9fe __imp_FindResourceW 9e7 __imp_FindStringOrdinal 944 __imp_FindVolumeClose 922 __imp_FlsAlloc 923 __imp_FlsFree --
Version : 0 Machine : 8664 (AMD64) TimeDateStamp: FFFFFFFF Sun Feb 7 07:28:15 2106 SizeOfData : 00000037 DLL name : api-ms-win-core-libraryloader-l1-2-1.dll Symbol name : FindResourceW Type : code Name type : name Hint : 10
Lib/10.0.17763.0/um/arm64/mincore.lib eafc0 SizeofResource eafc0 __imp_SizeofResource eb048 __IMPORT_DESCRIPTOR_api-ms-win-core-libraryloader-l1-2-1 eb2fe __NULL_IMPORT_DESCRIPTOR eb470 api-ms-win-core-libraryloader-l1-2-1_NULL_THUNK_DATA eb61a FindResourceW eb61a __imp_FindResourceW eb6a2 LoadLibraryA eb6a2 __imp_LoadLibraryA eb728 LoadLibraryW eb728 __imp_LoadLibraryW -- 93d __imp_FindNextFileA 987 __imp_FindNextFileNameW 93e __imp_FindNextFileW 988 __imp_FindNextStreamW 93f __imp_FindNextVolumeW 9e2 __imp_FindResourceExW 9fa __imp_FindResourceW 9e3 __imp_FindStringOrdinal 940 __imp_FindVolumeClose 91e __imp_FlsAlloc 91f __imp_FlsFree --
Version : 0 Machine : AA64 (ARM64) TimeDateStamp: FFFFFFFF Sun Feb 7 07:28:15 2106 SizeOfData : 00000037 DLL name : api-ms-win-core-libraryloader-l1-2-1.dll Symbol name : FindResourceW Type : code Name type : name Hint : 10
Lib/10.0.17763.0/um/x86/mincore.lib Lib/10.0.17763.0/um/x86/unicows.lib Lib/10.0.17763.0/um/arm/mincore.lib e8f30 SizeofResource e8f30 __imp_SizeofResource e8fb8 __IMPORT_DESCRIPTOR_api-ms-win-core-libraryloader-l1-2-1 e926e __NULL_IMPORT_DESCRIPTOR e93e0 api-ms-win-core-libraryloader-l1-2-1_NULL_THUNK_DATA e9582 FindResourceW e9582 __imp_FindResourceW e960a LoadLibraryA e960a __imp_LoadLibraryA e9690 LoadLibraryW e9690 __imp_LoadLibraryW -- 92d __imp_FindNextFileA 977 __imp_FindNextFileNameW 92e __imp_FindNextFileW 978 __imp_FindNextStreamW 92f __imp_FindNextVolumeW 9d2 __imp_FindResourceExW 9ea __imp_FindResourceW 9d3 __imp_FindStringOrdinal 930 __imp_FindVolumeClose 90e __imp_FlsAlloc 90f __imp_FlsFree --
Version : 0 Machine : 1C4 (ARMNT) TimeDateStamp: FFFFFFFF Sun Feb 7 07:28:15 2106 SizeOfData : 00000037 DLL name : api-ms-win-core-libraryloader-l1-2-1.dll Symbol name : FindResourceW Type : code Name type : name Hint : 10
Extension SDKs/WindowsMobile/10.0.17763.0/lib/um/x86/onecoreuap.lib Extension SDKs/WindowsMobile/10.0.17763.0/lib/um/arm/onecoreuap.lib b146c SizeofResource b146c __imp_SizeofResource b14f4 __IMPORT_DESCRIPTOR_api-ms-win-core-libraryloader-l1-2-1 b17aa __NULL_IMPORT_DESCRIPTOR b191c api-ms-win-core-libraryloader-l1-2-1_NULL_THUNK_DATA b1abe FindResourceW b1abe __imp_FindResourceW b1b46 LoadLibraryA b1b46 __imp_LoadLibraryA b1bcc LoadLibraryW b1bcc __imp_LoadLibraryW -- 288 __imp_FindNextVolumeMountPointW 1af __imp_FindNextVolumeW 5 __imp_FindPackagesByPackageFamily 289 __imp_FindResourceA 28a __imp_FindResourceExA 2d8 __imp_FindResourceExW 2f0 __imp_FindResourceW 2d9 __imp_FindStringOrdinal 1b0 __imp_FindVolumeClose 28b __imp_FindVolumeMountPointClose 172 __imp_FlsAlloc --
Version : 0 Machine : 1C4 (ARMNT) TimeDateStamp: FFFFFFFF Sun Feb 7 07:28:15 2106 SizeOfData : 00000037 DLL name : api-ms-win-core-libraryloader-l1-2-1.dll Symbol name : FindResourceW Type : code Name type : name Hint : 28 --- snip ---
I guess that could be handled in follow-up patch.
Make sure to include the dll/lib version you generated the .spec file from in the commit message.
$ wine --version wine-3.20-280-g6341fa89a6
Regards
https://bugs.winehq.org/show_bug.cgi?id=46101
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.21.
https://bugs.winehq.org/show_bug.cgi?id=46101
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|https://software-download.m |https://web.archive.org/web |icrosoft.com/download/pr/17 |/20190317015617/https://sof |763.1.180914-1434.rs5_relea |tware-download.microsoft.co |se_WindowsSDK.iso |m/download/pr/17763.1.18091 | |4-1434.rs5_release_WindowsS | |DK.iso