Repository navigation
Conversation
open_decision_for called prepare_write before CreateFileW/CreateFileA/ CreateFile2 ran, eagerly clearing any whiteout on the target path. If the underlying CreateFile call then failed (e.g. sharing violation, invalid flags/attributes, or access denied), no overlay file was created yet the whiteout was gone — resurrecting the deleted original game file. Add prepare_write_staged and open_decision_staged / open_decision_staged_for (matching the existing stage_write / commit_write split), and have apply_open_decision call commit_write only after CreateFile returns a valid handle, saving and restoring GetLastError across commit_write's whiteout persistence I/O so statuses like ERROR_ALREADY_EXISTS are not clobbered. Assisted-by: OpenCode (Gemini 4 Neon)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Review from the #1259 author — your fix and mine are complementary halves of the same third-party #577 audit, and we should sequence deliberately: you close failed-open resurrection (staging no longer removes whiteouts before the open succeeds); #1259 closes missing-parent conjuring (a guard at the top of |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test report for head Tested
Not tested
AI use
|
open_decision_forcalledprepare_writebeforeCreateFileW/CreateFileA/CreateFile2ran, eagerly clearing any whiteout on the target path. If the underlyingCreateFile*call then failed (e.g. sharing violation, invalid flags/attributes, orERROR_ACCESS_DENIED), no overlay file was created yet the whiteout was already gone—resurrecting the deleted original game file.This adds
prepare_write_stagedandopen_decision_staged/open_decision_staged_for(following the existingstage_write/commit_writepattern fromd903a80) and hasapply_open_decisioncallcommit_writeonly afterCreateFile*returns a valid handle, while saving and restoringGetLastError()acrosscommit_write's whiteout persistence I/O so statuses likeERROR_ALREADY_EXISTSare not clobbered.What is in it
crates/xcl/src/vfs.rs: splitprepare_write_stagedout ofprepare_writeandopen_decision_staged_for/open_decision_stagedout ofopen_decision_forso callers can defercommit_writeuntil the file open succeeds.crates/xcl/src/vfs_hooks.rs: pass staged decisions fromhk_create_file_w,hk_create_file_a, andhk_create_file_2intoapply_open_decision, committing only onhandle != INVALID_HANDLE_VALUEwhile preservingGetLastError(); add unit testfailed_create_file_preserves_whiteout_and_last_error.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib vfs: 23 passed, 0 failedRegression run
main:
PR:
Not tested
AI use
vfs.rsandvfs_hooks.rs, wrote the staged open fix and unit test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.