Repository navigation
VFS: report existing game files on CREATE_ALWAYS - #158
Merged
Merged
Conversation
The first overwrite of a visible game file creates a new overlay file, so the native open reports success with a zero last error. Preserve ERROR_ALREADY_EXISTS for the title after a successful redirected open.
Collaborator
|
Merged (main 6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on main eaa36b6: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.