HLE: fix DirectStorage file sharing and error capture #1496

Closed
Calvix2k wants to merge 1 commit from upstream-pr/1497 into main
Calvix2k commented 2026-11-24 18:28:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T18:28:59Z.


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
<!-- greyfinch-sync:Marvisak/VIctory:issue:6588674265 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1497). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-24T18:28:59Z. --- ## 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
acetonahard-code commented 2026-11-24 23:05:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:33:24Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146371519 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1497#issuecomment-7146371519). Originally posted by [acetonahard-code](https://github.com/acetonahard-code) on 2026-11-24T22:33:24Z. --- 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>
upstream-sync closed this pull request 2026-11-25 01:06:44 +00:00
Marvisak commented 2026-11-25 01:08:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:41:30Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148775961 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1497#issuecomment-7148775961). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:41:30Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1496
No description provided.