Skip to content

HLE: handle verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpaceW roots - #1772

Open
n-romanovich wants to merge 1 commit into
Marvisak:mainfrom
n-romanovich:fix/hle-files-verbatim-and-volume-roots
Open

n-romanovich wants to merge 1 commit into
Marvisak:mainfrom
n-romanovich:fix/hle-files-verbatim-and-volume-roots

Conversation

@n-romanovich

Copy link
Copy Markdown

Fixes #1742

Fixes virtual-drive path translation and volume-root extraction in crates/victory-hle/src/modules/files.rs:

  • Keep the trailing \ on verbatim drive-root mounts (\\?\C:\) in root_wide() and verbatim().
  • Route \\?\-mounted roots and \\?\ title paths through verbatim() so / and ./.. are normalized and \\?\ is never prepended twice; avoid doubling separators on plain drive-root mounts (C:\).
  • Extract volume roots in GetDiskFreeSpaceW via volume_root() for C:\, \\?\C:\, \\server\share\, and \\?\UNC\server\share\.
  • Add synthetic unit tests verbatim_and_drive_root_mounts_translate_cleanly and volume_root_extracts_drive_and_unc_roots.

AI-assisted; verified with cargo test -p victory-hle --locked (101 passed) and cargo clippy -p victory-hle --all-targets --locked.

@DesertGamer

Copy link
Copy Markdown

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally merged onto origin/main (70564ae, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-hle --lib files:: — 7 passed, 0 failed (including verbatim_and_drive_root_mounts_translate_cleanly and volume_root_extracts_drive_and_unc_roots)
  • cargo clippy -p victory-hle --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean handling of verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpaceW volume roots with targeted unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

Verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpace: path canonicalization edge cases in the HLE storage layer. 7.6K, well-scoped.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Recommended for a maintainer's look. In crates/victory-hle/src/modules/files.rs, translate now sends any title \\?\ path, or any mount whose root is itself \\?\, through verbatim(). That removes the doubled \\?\ prefix, converts / and resolves ./.. there, and produces \\?\UNC\... for UNC roots. root_wide and verbatim keep the backslash of a \\?\C:\ root, a C:\ mount no longer doubles separators, and GetDiskFreeSpaceW reduces verbatim and UNC paths to their volume root through the new volume_root. I traced each case in the new tests against the code and they hold; the bugs are as described in #1742. One small thing: the long strip_prefix line in volume_root is not rustfmt-formatted (CI does not run cargo fmt). CI: passing.


Generated by Claude Code

@n-romanovich
n-romanovich force-pushed the fix/hle-files-verbatim-and-volume-roots branch 2 times, most recently from 509187b to 3be90c4 Compare November 25, 2026 01:44
@n-romanovich

Copy link
Copy Markdown
Author

@Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.

@n-romanovich
n-romanovich force-pushed the fix/hle-files-verbatim-and-volume-roots branch from 3be90c4 to 92bc933 Compare November 25, 2026 01:47
@Calvix2k

Copy link
Copy Markdown
Contributor

Independent run on 92bc933, Windows 10 19045 (x64), current suite:

cargo test -p victory-hle --lib --locked — 145 passed, 0 failed. The suite has grown since your run (101 then), so the two new tests plus all existing ones are green here too. mergeable: true from GitHub on this head; the triage verdict from 02:20 was merge-candidate. Nothing in the diff looks off to me: the volume_root cases cover C:\, \\?\C:\, \\server\share\, \\?\UNC\…, and a relative path falls through to the host call unchanged, which is what Windows does.

@BaggyALPHA

Copy link
Copy Markdown
Contributor

Independent Windows validation on 940d32f and this PR at 92bc933. I canonicalized a temporary directory to get a verbatim host mount and exercised the real Win32 calls through our HLE wrappers.

Synthetic check Upstream With #1772
Open a fixture using forward slashes and a dot segment Fail Pass
Open the fixture using an extended virtual-drive path Fail Pass
Query free space using a plain virtual-drive root Pass Pass
Query free space using an extended virtual-drive root Fail Pass

cargo test -p victory-hle --locked --lib -- --test-threads=1 with the local probe: 146 passed, 0 failed. The fixture was generated locally. No game files or network shares were used.

Merge overlap: Git reports a conflict between this head and #421 (83b2037) in files.rs. Both route an already-extended title path through verbatim(). One explicit behavior to preserve or decide when resolving the overlap is #421's trailing separator for a bare extended virtual drive mounted to a host subdirectory. #1772 separately covers canonicalized host roots and volume queries.

AI-assisted (OpenAI Codex).

@StExpeditus

Copy link
Copy Markdown

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 92bc933. cargo test --workspace --locked --no-fail-fast -> 698 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HLE: virtual drives mishandle verbatim/drive-root mounts and GetDiskFreeSpaceW volume roots (fix on a fork)

8 participants