fix(hle): fix verbatim/UNC/drive-root virtual path translation and GetDiskFreeSpaceW volume roots #3361
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3361
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3361"
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?
@reeledMarek on GitHub · 2026-11-26 20:25 UTC · original
reeledMarek:fix/hle-files-verbatim-and-disk-free-space→main· +172 −32 · 1 files · 2 commits · openSummary
\\?\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@Dukestar69 on GitHub · 2026-11-26 20:27 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).\\?\), 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 on GitHub · 2026-11-26 20:54 UTC · original · approved these changes
LGTM —
verbatim_root,join_host_path, andvolume_rootcleanly resolve the\?\,\?\UNC\, and drive-root joining edge cases and extract volume roots forGetDiskFreeSpaceW.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.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.@reeledMarek on GitHub · 2026-11-26 21:04 UTC · original
Thanks for the thorough review @fuzeofficlal! Pushed
60296b7to guard the trailing\inverbatim()withparts.is_empty()(with a regression test covering both an empty-tail drive root and a colon-suffixed component) and fixed therustfmtformatting line.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.