VFS: report existing game files on CREATE_ALWAYS #155
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/158"
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 ebarr24 on 2026-11-23T17:47:25Z.
When
CREATE_ALWAYSoverwrites an existing file, Win32 returns a valid handle and setsGetLastError()toERROR_ALREADY_EXISTS(183). XCL's first overwrite of a game file creates a new physical overlay file. That open succeeds with last error0, so the title sees the file as newly created. Win32 CreateFileW contractThe
CreateFileW,CreateFileA, andCreateFile2hooks share the same open decision. When a visible original file has no overlay entry, reportERROR_ALREADY_EXISTSafter the redirected overwrite succeeds. The test covers the first overwrite, an existing overlay file, a new path, and a previously deleted path. It checks the original bytes and verifies that a native open failure preserves its error.Verification
On Windows 11 25H2 (26200.9711), Rust 1.100.0
x86_64-pc-windows-gnu, RTX 3080 (driver 616.92), and DXC 1.9.2609.5:db5dc26, overwriting a game file for the first time succeeds with0instead of183.323767fthe regression passes.9f1a048with the independent fixture test fix reported 569 passes, zero failures and 39 ignored. Two native-wave64 tests and the unconfigured retail-sample tests returned early. Fixture test fix #157AI-assisted patch preparation and verification.
Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:09:06Z.
Merged (main
6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on maineaa36b6:cargo build --workspace && cargo test --workspace -- --test-threads=4- 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).