HLE media: translate \??\<drive> paths through the virtual drives #3271
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3273"
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 andrewpozdnakov7-jpg on 2026-11-26T15:23:34Z.
media::localhandles\\?\<drive>by letting the path reachfiles::translate, but the\??\<drive>spelling returned early with the title's URL unchanged. A title that opens a media file as\??\G:\video.mp4handed Media Foundation the virtual drive letter instead of the host folder behind it.The
\??\branch now translates the drive path like the other spellings, and keeps the title's own spelling when the drive is not virtual, so\??\C:\Windows\a.wavstill comes back exactly as given.mediatests:\??\<letter>:\movies\intro.mp4reads the file from the mounted folder, next to the existing\\?\andfile:cases.cargo test -p victory-hle: all suites pass (147 lib tests plus the probes).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.Fixes #2410.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T15:27:02Z.
Review: APPROVED
Reviewed the diff and verified locally on Windows 11 x64:
\??\<drive>paths viafiles::translate(&wide)while preserving untranslated host-drive paths viaunwrap_or_else(|| with_nul(url))cleanly aligns\??\with\\?\for virtual drives.cargo test -p victory-hle --lib modules::media:: -- --test-threads=1: 5 passed, 0 failed (includingonly_local_files_reach_the_hostcovering\??\<drive>).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).
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-26T15:27:49Z.
Review: COMMENTED
The change is correct:
resttakes the samefiles::translatepath as plain drive paths, and a host drive keeps the title's\??\spelling.But #2089 (still open) already fixes
\??\virtual-drive translation, in bothmedia.rsandfiles.rs. #3030 was closed in favour of it, and #2416 (same issue, #2410) was closed too. Worth linking it and agreeing with its author which one goes forward, since this one covers only the media half.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T21:16:17Z.
Review: APPROVED
LGTM — verified against
origin/main(63bcca43) on Windows x64.\??\<drive>paths now translate throughfiles::translatejust like other virtual drive paths, while unmounted host drives fall back towith_nul(url)with the\??\prefix intact and\??\UNC\...stays rejected.String::from_utf16_lossy(crates/victory-hle/src/modules/media.rs:45, 69) replaces any unpaired UTF-16 surrogate in a mounted\??\path withU+FFFD(matching the plain drive-letter path at line 111); passing&url[4..]directly tofiles::translatewould preserve raw UTF-16 code units if ever needed.cargo test --locked -p victory-hle --lib -- --test-threads=1 modules::media::: 5 passed, 0 failed (including the new\??\{letter}:assertion).cargo clippy -p victory-hle --all-targets --locked -- -D warnings(default and--all-features): clean.cargo xtask policy: 191 files ok;rustfmt --edition 2024: clean.Synthetic tests only; no game data used.
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:34:09Z.
Windows 11,
63bcca4+ this PR:cargo test -p victory-hle media::: 5 passed / 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.The modified test now also asks for
\??\<drive>:\movies\intro.mp4and gets the same file as the plain drive path, so the object-manager spelling of a virtual drive is translated; a host drive under\??\still comes back as the title spelled it (thefiles::translatefallback). Synthetic only. AI-assisted.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.