Preserve Win32 errors from DirectStorage OpenFile #1383
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1383"
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 Marvisak/VIctory. Originally posted by EatCodeSleep2 on 2026-11-24T17:40:07Z.
Addresses VIC-BT-037 in #1249. Capture the host error before decoding the path for the DirectStorage log. Preserve the host thread error around disposal of the translated path in CreateFileW so virtual-drive opens report the same error as direct opens. Keep the documented read access and sharing mode.
Added a factory-vtable test checking the distinct HRESULTs for a missing file and missing parent directory. All 95 victory-hle library tests pass on Windows.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:49:17Z.
Review: COMMENTED
Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; this is source review plus the PR's own Windows tests.
Two Win32 error-preservation fixes: dstorage open_file captures last_os_error BEFORE building the lossy path string (which can clobber the thread error), and files.rs CreateFileW saves/restores GetLastError around dropping the translated path. The test asserts the exact HRESULTs for missing file (0x80070002) vs missing directory (0x80070003). Classic last-error hygiene; correct.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:37:26Z.
Automated triage for the maintainers. Recommended for a maintainer's look:
open_fileincrates/victory-hle/src/modules/dstorage.rsnow captures the last OS error right afterCreateFileW, before allocating the path string for the log, andCreateFileWinfiles.rssaves and restores the thread's last error around dropping the translated virtual-drive path. Win32 does not promise that heap calls leave the last error alone, so reading it first is the correct order; the change is small and useswindows-sysfeatures already enabled. Note that the new test (missing file -> 0x80070002, missing directory -> 0x80070003) most likely passes on main too, so it pins the behaviour rather than reproducing a failure. CI passes.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:00:47Z.
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because it changes no behaviour. Between
CreateFileWand the error read there is only a successful heap allocation and free, which do not set the thread's last error, somainalready returns the same HRESULT: with both source files put back tomainand only the new test kept,open_file_preserves_win32_errorstill passes.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed