[Bug 60070] New: wintypes: ApiInformation.IsPropertyPresent returning E_NOTIMPL crashes C++/WinRT apps (Marvel's Spider-Man: Miles Morales)
http://bugs.winehq.org/show_bug.cgi?id=60070 Bug ID: 60070 Summary: wintypes: ApiInformation.IsPropertyPresent returning E_NOTIMPL crashes C++/WinRT apps (Marvel's Spider-Man: Miles Morales) Product: Wine Version: 11.0 Hardware: x86-64 OS: MacOS Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@list.winehq.org Reporter: debsnilsamudra@gmail.com Target Milestone: --- Created attachment 81577 --> http://bugs.winehq.org/attachment.cgi?id=81577 Patch: return S_OK/FALSE from IApiInformationStatics stubs instead of E_NOTIMPL (vs Wine 11.0) IApiInformationStatics capability queries in dlls/wintypes/main.c return E_NOTIMPL, which is a FAILURE HRESULT. C++/WinRT translates a failing HRESULT into a thrown C++ exception. Callers use these APIs for optional-feature detection and expect a boolean answer, not a throw, so nothing catches it and the CRT terminates the process via __fastfail. Marvel's Spider-Man: Miles Morales (Epic, MilesMorales.exe 4.630.0.0) calls ApiInformation.IsPropertyPresent() during display initialisation and dies ~2 seconds after launch, with no error dialog. This is the same class of bug Wine has fixed before: a stub returning a failure HRESULT where a benign result was appropriate. See bug 31350 (dwmapi.DwmGetTransportAttributes returning E_NOTIMPL crashed .NET/WPF apps) and bug 32408 (WindowsCodecs PngDecoder_Frame_GetThumbnail returning E_NOTIMPL instead of WINCODEC_ERR_CODECNOTHUMBNAIL). Both were fixed by returning something the caller can handle rather than a failure code. SetThreadDescription returning E_NOTIMPL likewise crashed Star Citizen. STEPS TO REPRODUCE (deterministic, no special hardware needed) The trigger is a stale monitor index in the game's own saved config. The game persists its display target to HKCU\Software\Insomniac Games\Marvel's Spider-Man Miles Morales\Graphics: "Monitor" = dword:00000001 (index of a monitor no longer attached) "FullscreenWidth" = dword:00000f00 (3840) "FullscreenHeight" = dword:00000870 (2160) 1. Attach a second monitor. 2. Launch the game and set it to that second monitor. Quit normally so settings persist. 3. Disconnect the second monitor. 4. Launch again. The saved index no longer resolves, the game enters its "selected monitor was invalid" fallback, and that path performs the WinRT capability query that crashes. The game's own log (Documents/Marvel's Spider-Man Miles Morales/*.log) shows this line only in the failing case: [Validate Settings] Selected monitor was invalid, using default monitor. ACTUAL RESULT Process exits ~2 seconds after launch. Trace excerpt (WINEDEBUG=+seh,+wintypes,+combase); full log attached: fixme:wintypes:api_information_statics_IsPropertyPresent fixme:combase:RoOriginateLanguageException 0x80004001, L"": stub seh:dispatch_exception code=e06d7363 (EXCEPTION_WINE_CXX_EXCEPTION) info[0]=0x19930520 (MSVC C++ throw magic) info[3]=0x140000000 (thrown by MilesMorales.exe) seh:call_seh_handlers ... returned 1 (x5, nothing catches it) err:seh:NtRaiseException Unhandled exception code c0000409 addr 0x1400c0075 0x80004001 is E_NOTIMPL. 0xC0000409 is STATUS_STACK_BUFFER_OVERRUN, which __fastfail also raises. EXPECTED RESULT The game starts. IsPropertyPresent should report the property as absent rather than failing the call, since under Wine these WinRT APIs genuinely are not present. SUGGESTED FIX Return S_OK with *value = FALSE from the IApiInformationStatics capability queries instead of E_NOTIMPL: IsTypePresent, IsMethodPresent, IsMethodPresentWithArity, IsEventPresent, IsPropertyPresent, IsReadOnlyPropertyPresent, IsWriteablePropertyPresent, IsEnumNamedValuePresent. IsApiContractPresentByMajorAndMinor can additionally delegate to the existing is_api_contract_present() helper that IsApiContractPresentByMajor already uses. The existing !type_name -> E_INVALIDARG guards should stay as they are. Patch attached. With only this patch applied the WinRT crash is gone entirely. This code is unchanged on current master (verified 2026-07-26). ENVIRONMENT Wine 11.0 as shipped in CrossOver 26.3.0 (cxoffice-26.3.0rc2, build 20260715T103801Z) macOS 26.5.2 (build 25F84), Apple M5 Pro, arm64 host running x86_64 PE code Game: MilesMorales.exe 4.630.0.0, Epic build Build_20260630.0, D3D12-only Not runtime-verified on upstream Wine on Linux - no Linux machine available. The affected source in dlls/wintypes/main.c is upstream code, not a CrossOver modification. NOT DUPLICATES, checked: bug 3930 (Miles Sound System, name collision only), bugs 55415 / 56785 / 57212 (Spider-Man: Shattered Dimensions), bug 55714 (Spider-Man Remastered, d3d12 pipeline state). Also ruled out as causes: network/online state (crashes with Wi-Fi off), game file integrity (Epic's own verify completes clean, 0 files changed), game version, macOS version, CrossOver version (26.2 and 26.3 identical), power source, and the Epic overlay (crash unchanged with EOSOVH-Win64-Shipping.dll renamed so it cannot load). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60070 Debsnil Samudra <debsnilsamudra@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |debsnilsamudra@gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60070 --- Comment #1 from Debsnil Samudra <debsnilsamudra@gmail.com> --- Created attachment 81578 --> http://bugs.winehq.org/attachment.cgi?id=81578 Wine trace (+seh,+wintypes,+combase) showing the E_NOTIMPL throw and c0000409 fastfail -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60070 --- Comment #2 from Ken Sharp <imwellcushtymelike@gmail.com> --- Wine 11.14 has been released. https://gitlab.winehq.org/wine/wine/-/wikis/Download -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60070 --- Comment #3 from Debsnil Samudra <debsnilsamudra@gmail.com> --- Thanks. I can't test 11.14 directly - this was found under CrossOver 26.3, which is based on Wine 11.0, and I don't have a Linux machine to run a stock build on. But the relevant code is unchanged on master, so I don't believe 11.14 behaves differently here. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60070 --- Comment #4 from Debsnil Samudra <debsnilsamudra@gmail.com> --- (In reply to Ken Sharp from comment #2)
Wine 11.14 has been released. https://gitlab.winehq.org/wine/wine/-/wikis/Download
Thanks. I can't test 11.14 directly - this was found under CrossOver 26.3, which is based on Wine 11.0, and I don't have a Linux machine to run a stock build on. But the relevant code is unchanged on master, so I don't believe 11.14 behaves differently here. As of master HEAD (Release 11.14, 2026-07-24), dlls/wintypes/main.c: static HRESULT STDMETHODCALLTYPE api_information_statics_IsPropertyPresent( IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, BOOLEAN *value) { FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface, debugstr_hstring(type_name), debugstr_hstring(property_name), value); if (!type_name) return E_INVALIDARG; return E_NOTIMPL; } Worth pointing out that this exact change has already been made upstream for the sibling method, in commit 0e2c293091c7 (2026-03-10, "wintypes: Return S_OK for api_information_statics_IsMethodPresent()"). IsMethodPresent now does: if (!type_name) return E_INVALIDARG; *value = FALSE; return S_OK; IsPropertyPresent is ten lines below it in the same file and still returns E_NOTIMPL. The attached patch applies the same treatment to IsPropertyPresent and the remaining IApiInformationStatics capability queries (IsTypePresent, IsMethodPresentWithArity, IsEventPresent, IsReadOnlyPropertyPresent, IsWriteablePropertyPresent, IsEnumNamedValuePresent), leaving the !type_name -> E_INVALIDARG guards intact. Note the patch was generated against 11.0, so its IsMethodPresent hunk is already applied upstream and will need dropping when rebased onto master. If a reproduction on stock Wine is required before this can be actioned, I understand - I just can't provide one myself. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla