VFS: hook FindFirstFileExA, which Windows does not send to the W hooks #1264
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!1264
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1264"
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?
@emirduran707 on GitHub · 2026-11-24 13:59 UTC · original
emirduran707:vfs-find-first-ex-a→main· +90 −0 · 2 files · 1 commits · openFindFirstFileExAwas not hooked, and on Windows it does not go through the hooks that are:kernel32!FindFirstFileExAjumps to its ownkernelbaseexport, and that reaches neitherFindFirstFileExWnorFindFirstFileA. Measured on Windows 11 26300 by replacing each of those with a stub that fails:FindFirstFileExA("C:\Windows\*")still listed the folder, while a stub onkernelbase!FindFirstFileExAitself stopped it. #59 noted thatFindFirstFileExAworks through the W hooks; that was measured under Wine, where it holds.So a title's
FindFirstFileExA("G:\data\*", …)went straight to Windows. With noG:on the PC it failed withERROR_PATH_NOT_FOUND; with a PC drive of that letter it listed the PC's folder; and a real path into the game folder listed the original files, without the overlay's files and with deleted ones still there.hk_find_first_ex_ahandles it likehk_find_first_a: the same info levels and search ops as the W hook go to the merged listing (find_first_vfs, then converted toWIN32_FIND_DATAA), and the rest pass through.FindNextFileAandFindClosealready handle the merged handle.What is in it
crates/xcl/src/vfs_hooks.rs: the hook and its entry in the kernelbase list.crates/xcl/tests/vfs_find_ansi.rs(new; an integration test, since the hooks act through the global VFS): a game folder with two files, an overlay with a third and a deletion of one original. ListingG:\data\*withFindFirstFileExA/FindNextFileA/FindCloseat info levels 0 and 1 must give exactly the merged names.Tested
cargo test --workspace -- --test-threads=4on3755c18: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsFindFirstFileExA("G:\\data\\*", 0) failed: error 3; with it it passesRegression run
main:
this PR:
Not tested
kernelbaseto exportFindFirstFileExA.FindFirstFileExAdirectly; the smoke title's run is a regression check only.AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 14:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@thehollowedone on GitHub · 2026-11-24 14:09 UTC · original
Independent native Windows check on
3755c18, Windows 11 build 26300, Rust 1.99.1 MSVC, debug.I extended the synthetic fixture to enumerate the same wildcard through the game folder’s absolute Windows path as well as
G:. With bothFindExInfoStandardandFindExInfoBasic, the PR returnedadded.txtandoriginal.txtfor the absolute path. Restoring the parent hooks returneddeleted.txtandoriginal.txtinstead. A separate unmapped host directory listed correctly in both builds and at both info levels. The stockG:assertions passed on the PR.Synthetic files only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended and ran the scratch fixture and drafted this report.
@DavidM1911 on GitHub · 2026-11-26 04:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.