HLE: fix DirectStorage file sharing and error capture #1497

Closed
github-bot wants to merge 1 commit from gh-pr/1497/head into gh-pr/1497/base
Owner

@⁠Calvix2k on GitHub · 2026-11-24 18:28 UTC · original
Calvix2k:codex/dstorage-open-share-037 → main · +63 −3 · 1 files · 1 commits · closed without merging

Summary

  • Capture GetLastError immediately when CreateFileW fails, before formatting the path or logging.
  • Open DirectStorage files with read, write, and delete sharing so existing write/delete handles do not cause avoidable sharing violations.

Addresses VIC-BT-037 from the audit in #1249.

Verification

  • cargo test -p victory-hle --lib — 96 passed
  • cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings — passed
  • Repository pre-commit asset-policy hook — passed
  • git diff --check — passed
**@⁠Calvix2k** on GitHub · 2026-11-24 18:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1497) `Calvix2k:codex/dstorage-open-share-037` → `main` · +63 −3 · 1 files · 1 commits · closed without merging ## Summary - Capture `GetLastError` immediately when `CreateFileW` fails, before formatting the path or logging. - Open DirectStorage files with read, write, and delete sharing so existing write/delete handles do not cause avoidable sharing violations. Addresses VIC-BT-037 from the audit in #1249. ## Verification - `cargo test -p victory-hle --lib` — 96 passed - `cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings` — passed - Repository pre-commit asset-policy hook — passed - `git diff --check` — passed
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:34:01 +00:00
github-bot closed this pull request 2026-11-26 04:34:01 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 22:33 UTC · original

Partial overlap: #1383 (opened earlier) also captures the CreateFileW error in DirectStorage open_file before the path is decoded for the log. This PR also widens the share mode. The two conflict in dstorage.rs.

Tested on Windows 11 with the repo toolchain, merged into current main (70564ae):

cargo test -p victory-hle passed failed ignored
main 99 0 0
main + this PR 101 0 0
  • The 2 new tests pass.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 22:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1497#issuecomment-7146371519) Partial overlap: #1383 (opened earlier) also captures the `CreateFileW` error in DirectStorage `open_file` before the path is decoded for the log. This PR also widens the share mode. The two conflict in `dstorage.rs`. Tested on Windows 11 with the repo toolchain, merged into current `main` (70564ae): | `cargo test -p victory-hle` | passed | failed | ignored | |---|---|---|---| | `main` | 99 | 0 | 0 | | `main` + this PR | 101 | 0 | 0 | - The 2 new tests pass. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:41 UTC · original

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1383. Its error-capture half duplicates #1383; the other half opens DirectStorage files with write and delete sharing, a behaviour change with no evidence.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1497#issuecomment-7148775961) Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1383. Its error-capture half duplicates #1383; the other half opens DirectStorage files with write and delete sharing, a behaviour change with no evidence. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1497
No description provided.