VFS hooks: the guard keeps the thread's last error #91
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/92"
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?
Imported from ivall/xcl. Originally posted by ozimchuk on 2026-11-23T10:42:46Z.
The 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
precise, and thes_round_modeNOOPs are not free #72Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T11:03:07Z.
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!precise, and thes_round_modeNOOPs are not free #72