Skip to content

fix: fall back to Win32 UI and downlevel SEH handling under Wine - #4095

Open
RatPrez wants to merge 2 commits into
citizenfx:masterfrom
RatPrez:master
Open

fix: fall back to Win32 UI and downlevel SEH handling under Wine#4095
RatPrez wants to merge 2 commits into
citizenfx:masterfrom
RatPrez:master

Conversation

@RatPrez

@RatPrez RatPrez commented Jul 29, 2026

Copy link
Copy Markdown

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 in LaunchMode.h so native Windows behavior is untouched:

  1. client/launcher/UpdaterUI.cpp

The 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 forceOff checks in UI_InitTen() so it takes that path instead of trying to init XAML and dying.

  1. client/citicore/SEHTableHandler.Win32.cpp

CoreRT_SetupSEHHandler disassembles RtlLookupFunctionTable in ntdll.dll to locate the internal RtlpxLookupFunctionTable.

Wine's ntdll doesn't match real ntdll's binary layout, so the lookup never finds it, and since IsWindows8OrGreater() reports true under Wine, it was hitting a FatalError().

The code already has a fallback path for genuinely older/downlevel OS's that hooks RtlLookupFunctionTable directly 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

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 29, 2026
RatPrez added 2 commits July 30, 2026 01:00
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant