fix: fall back to Win32 UI and downlevel SEH handling under Wine - #4095
Open
RatPrez wants to merge 2 commits into
Open
fix: fall back to Win32 UI and downlevel SEH handling under Wine#4095RatPrez wants to merge 2 commits into
RatPrez wants to merge 2 commits into
Conversation
Wine's ntdll doesn't match real ntdll's binary layout, so RtlpxLookupFunctionTable is never found there either, even on builds that report as Windows 8+. Skip straight to hooking RtlLookupFunctionTable directly when running under Wine, same as we already do for pre-Win8 systems.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Get the legacy FiveM client to a point where it can actually start under Wine/Proton on Linux. Right now it doesn't get past the launcher, two separate things kill it before you even see a window.
Let me know if there is any genuine issues with this code being merged.
...
How is this PR achieving the goal
Two unrelated Wine-compat fixes, both gated behind the existing
CfxIsWine()check inLaunchMode.hso native Windows behavior is untouched:client/launcher/UpdaterUI.cppThe update/patch splash screen is built with WinRT XAML Islands
DesktopWindowXamlSource, which Wine doesn't implement.The code already has a working plain-Win32-controls fallback
g_uui.tenMode = false, used for older Windows and safe mode.Added Wine to the existing
forceOffchecks inUI_InitTen()so it takes that path instead of trying to init XAML and dying.client/citicore/SEHTableHandler.Win32.cppCoreRT_SetupSEHHandlerdisassemblesRtlLookupFunctionTableinntdll.dllto locate the internalRtlpxLookupFunctionTable.Wine's
ntdlldoesn't match real ntdll's binary layout, so the lookup never finds it, and sinceIsWindows8OrGreater()reports true under Wine, it was hitting aFatalError().The code already has a fallback path for genuinely older/downlevel OS's that hooks
RtlLookupFunctionTabledirectly instead, routed Wine into that same path instead of the fatal error....
This PR applies to the following area(s)
FiveM
...
Successfully tested on
Platforms: Linux
...
Checklist