VFS hooks: the guard keeps the thread's last error #92
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!92
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/92/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-last-error→main· +2 −0 · 1 files · 1 commits · merged 2026-11-23 11:02 UTCThe hooks' re-entrancy guard is a
thread_local. In a build with the GNU toolchain (x86_64-pc-windows-gnu) athread_localaccess goes throughTlsGetValue, which sets the thread's last error to 0. The guard is dropped after the original function has returned, so a failing call came back withGetLastError() == 0.The visible effect:
std::fs::create_dir_allon a directory that already exists fails withSuccess. (os error 0), and no title loads:The drop now saves the last error and puts it back. MSVC builds use static TLS and are not affected either way.
Validation
Linux, Wine with vkd3d-proton, GNU toolchain build,
mainat1f82be3:xcl run <testgame> -- --hello)main+ the other Wine fix (#93) onlymain+ this change + #93[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 #175@ivall on GitHub · 2026-11-23 11:03 UTC · original
Merged – a no-op for MSVC builds as you say, and correct for the GNU toolchain. 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