Repository navigation
fix(hle): fix verbatim/UNC/drive-root virtual path translation and GetDiskFreeSpaceW volume roots - #3361
Open
reeledMarek wants to merge 1 commit into
Conversation
Dukestar69
approved these changes
Nov 26, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows against origin/main (63bcca4).
- Handling verbatim (
\\?\), UNC (\\?\UNC\.../\\server\share), and drive-root mounts cleanly in virtual path translation andGetDiskFreeSpaceWvolume root extraction is well-tested and avoids malformed path joins. cargo test -p victory-hle --lib modules::files:: -- --test-threads=1: 8 passed, 0 failed (includingverbatim_and_drive_root_mounts_join_cleanlyandvolume_root_handles_drive_verbatim_and_unc_paths).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal
approved these changes
Nov 26, 2026
fuzeofficlal
left a comment
Contributor
There was a problem hiding this comment.
LGTM — verbatim_root, join_host_path, and volume_root cleanly resolve the \?\, \?\UNC\, and drive-root joining edge cases and extract volume roots for GetDiskFreeSpaceW.
Verified
cargo run --locked -p xtask -- policy:191 files ok.cargo clippy --locked -p victory-hle --all-targets -- -D warnings(default &--all-features): clean.cargo test --locked -p victory-hle --lib modules::files:: -- --test-threads=1: 8 passed, 0 failed (includingverbatim_and_drive_root_mounts_join_cleanlyandvolume_root_handles_drive_verbatim_and_unc_paths).cargo test --locked -p victory-hle --all-targets -- --test-threads=1: 154 lib + 2 integration tests passed, 0 failed.
Minor non-blocking nits
crates/victory-hle/src/modules/files.rs:150:if out.last() == Some(&u16::from(b':'))runs after appendingparts; guarding it withparts.is_empty()limits the trailing\strictly to empty-tail drive roots rather than a colon-suffixed guest component.- Pre-existing
join_host_pathbehavior (files.rs:164, 179):/->\normalization checks!prefix.is_empty()rather than whetheroutstarts with\?\(so a short non-verbatim guest path on a\?\mount keeps/), and short non-verbatim paths still rely on Windows path resolution for... rustfmt --edition 2024reports one formatting diff in the new test atfiles.rs:1046.
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.
Summary
\\?\verbatim virtual-drive path (e.g.\\?\G:\...),translateblindly prepended\\?\to the mounted hostroot, producing invalid paths for UNC mounts (\\?\\\server\share\...instead of\\?\UNC\server\share\...), already-verbatim mounts (\\?\\\?\...), and drive-root mounts (\\?\D:\\fooorD:\\foo).verbatim_rootandjoin_host_pathso verbatim, UNC, and drive-root mounts join cleanly without duplicate prefixes or doubled backslashes.volume_rootforGetDiskFreeSpaceWso\\?\C:\...,\\?\UNC\server\share\..., and\\server\share\...translated host paths are trimmed to a valid volume root instead of passing a subdirectory.verbatim_and_drive_root_mounts_join_cleanlyandvolume_root_handles_drive_verbatim_and_unc_paths.Verification
cargo clippy -p victory-hle --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningscargo test -p xtask --locked