VFS: a delete through a handle hides the game file (#998) #1054
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!1054
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1054"
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?
@CharlyRien on GitHub · 2026-11-24 10:57 UTC · original
CharlyRien:vfs/delete-by-handle→main· +155 −0 · 1 files · 1 commits · openA game file deleted through a handle came back:
SetFileInformationByHandlewas not hooked, so the delete removed only the overlay copy the handle points at and no whiteout was recorded. MSVC'sstd::filesystem::removedeletes this way. Part of #998 (the delete-by-handle case for files).What is in it
crates/xcl/src/vfs_hooks.rs: a hook onSetFileInformationByHandle. After a successfulFileDispositionInfo/FileDispositionInfoExdelete on a file inside the overlay, the whiteout is recorded through the existingcommit_overlay_removal; a disposition that takes the delete back removes it. Everything else is passed through unchanged: other information classes, handles outside the overlay, failed calls.delete_by_handle_hides_the_game_fileandset_file_info_by_handle_passes_everything_else_through.Tested
stable-x86_64-pc-windows-msvc; release; DXC 1.9.2602.17cargo test --workspace --release --no-fail-fast -- --test-threads=4on this PR's head: 729 passed, 0 failed, 41 ignored (mainat02bfd1d: 727 passed, 0 failed, 41 ignored)no wave64(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware). With--nocapture,mainshows 3 more on this machine (no reserved cube with mips on this adapter; no D3D12 debug layer installed, twice); that run was not repeated on the PR.delete_by_handle_hides_the_game_filefails without the new logic (withset_file_info_vfsreturning the original call's result at once: 11 passed, 1 failed incargo test -p xcl --release --lib vfs_hooks, at the whiteout assertion).Regression run
main:
PR:
Not tested
dumpbin -importsshows noSetFileInformationByHandlein its exe,msvcp140.dll,XCurl.dllorlibHttpClient.GDK.dll, and itsmsvcp140.dllexports no__std_fs_*function. For files the exe importsDeleteFileW,RemoveDirectoryW,MoveFileExW,CreateFileW,CreateDirectoryW,FindFirstFileWand the CRT'sremove. A call throughGetProcAddressis not ruled out. The run'sreport.jsonhas an emptyvfssection (no redirected writes, no whiteouts). So this fixes a case found by reading the code, not one seen in a game; other titles were not checked.std::filesystem::removereaches the kernelbaseSetFileInformationByHandleexport (only the unit tests andpls_quota, which installs the hooks, cover it).FILE_FLAG_DELETE_ON_CLOSE(andFILE_DISPOSITION_FLAG_ON_CLOSE, passed through), rename by handle, skipping the content copy for aDELETE-only open.prepare_writebehaviour); not tested.vfs::tests::truncate_existing_validation_errorsfails when only thevfstests are run (cargo test -p xcl --release --lib vfs: 21 passed, 1 failed, 3 runs of 3, last error 127 where 5 is expected) and passes in the whole suite. Seen with this PR; reported by the tool as the same without it, which I did not rerun myself. Not touched here.AI use
🤖 Generated with Claude Code
@dcastell1 on GitHub · 2026-11-24 11:07 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@384f7f7(baseline 737 passed, 0 failed, 41 ignored on this box):Two more passing tests than the baseline, and the e2e that #1038 leaves red on this base passes here — the whiteout the title's delete-through-a-handle writes is in the list. Worth cross-checking with #1038's author, since both are after the same behaviour.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@DavidM1911 on GitHub · 2026-11-25 09:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
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.