Loader: under Wine, PEB.ImageBaseAddress keeps the real main image #93
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!93
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/93/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ozimchuk on GitHub · 2026-11-23 10:42 UTC · original
ozimchuk:wine-keep-image-base→main· +7 −1 · 1 files · 1 commits · merged 2026-11-23 11:02 UTCrun_mainwrites the title's base intoPEB.ImageBaseAddressso thatGetModuleHandle(NULL)answers the title. Wine's loader looks that address up in its own module list whenever a thread starts (loader_init:get_modref(Peb->ImageBaseAddress)) and uses the result unchecked. A manually mapped image is not in that list, so the title's first thread dies in ntdll with an access violation (a read at address0x6e).Under Wine (ntdll exports
wine_get_version) the field is now left alone, and a log line says so. Nothing changes on Windows.Known cost under Wine:
GetModuleHandle(NULL)answersxcl.exethere, not the title. The test title's check for it passes here; a title that reads resources from its own image through a NULL module may need more.Validation
Linux, Wine with vkd3d-proton, GNU toolchain build,
mainat1f82be3:xcl run <testgame> -- --hello)main+ the other Wine fix (#92) onlymain+ this change + #92[PASS], 2[FAIL]on an AMD iGPU (RADV) and on an RTX 5060 TiThe two failing checks are not about this change (
xmemworking-set statistics; the console window "not cloaked" under Wine). The run needs a locally patched vkd3d-proton for reasons that have nothing to do with this change either (it asserts on objects whose vtable XCL replaced); that is a separate topic. Not run on Windows.AI-assisted.
🤖 Generated with Claude Code
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175github-bot referenced this pull request2026-11-26 04:19:41 +00:00
@ivall on GitHub · 2026-11-23 11:03 UTC · original
Merged. On Windows nothing changes (
wine_get_versionis not exported), and the test title and games run as before. Noted theGetModuleHandle(NULL)cost under Wine in the log line. Checked on Windows 11 with an RX 9070 (RDNA4, MSVC build):cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), natively and withXCL_SPLIT_WAVE64=1. Thanks!mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175