HLE/Media: translate \??\<drive>:\ NT object-manager paths through virtual drive mounts #3028
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3030"
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 RVZO6 on 2026-11-26T03:59:46Z.
media::local(crates/victory-hle/src/modules/media.rs:61-67) previously returnedOk(with_nul(url))immediately for\??\<drive>:\...paths, bypassingfiles::translateeven though\\?\<drive>:\...paths right above (L56-60) rewrite mounted virtual console drives (G:\,T:\, etc.) to their host directories.Convert
\??\<rest>to\\?\<rest>and pass it tofiles::translate, falling back towith_nul(url)when the drive is not a mounted virtual drive so:\??\G:\movies\clip.mp4) resolve identically to\\?\G:\movies\clip.mp4.\??\C:\Windows\a.wav) preserve their original\??\spelling.\??\paths (e.g.\??\UNC\server\share\a.mp4) remain rejected as shares.Disjoint from #663 (which does not modify
local()'s\??\branch).Verification
object_manager_prefix_translates_virtual_drivesfailed (left: "\\??\\Y:\\movies\\clip.mp4",right: "\\\\?\\...\\movies\\clip.mp4").modules::media::testspass.--tests+--features diagnosticsclippy,xtask policy, full workspace tests): RVZO6/VIctory CI run #45748741503 (green, combined Wave 10 check on63bcca4).AI-assisted: T3 Code (Antigravity, gemini-4-neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T04:11:53Z.
Review: CHANGES_REQUESTED
Two issues to flag on
de808e50:\\?\prefix when a virtual drive root is already verbatim (crates/victory-hle/src/modules/media.rs:68-69,crates/victory-hle/src/modules/files.rs:168-170):Constructing
format!(r"\\?\{rest}")and passing it intofiles::translatecausesfiles::translateto unconditionally prepend\\?\onto the stored mount root (out = prefix.to_vec(); out.extend_from_slice(root)). If the mounted drive root already starts with\\?\(for example fromstd::fs::canonicalize), the translated path becomes\\?\\\?\D:\..., which failsCreateFileWwithERROR_INVALID_NAME(123). (By contrast,files::verbatimatfiles.rs:115explicitly checksroot.starts_with(&VERBATIM).)#2089already addresses\??\object-manager path translation across bothfiles::translateandmedia::local(including avoiding duplicate\\?\prefixes on verbatim mount roots and avoiding lossy UTF-16 round-tripping).If keeping this PR separate, please avoid duplicating the
\\?\prefix on verbatim mount roots and add a regression test covering a\\?\-prefixed mount root as well as mixed forward slashes in the tail.Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T04:37:40Z.
Review: APPROVED
LGTM — ??\ drive paths now go through files::translate via the ?\ verbatim spelling, so mounted virtual drives resolve while unmounted ones keep the original spelling. UNC stays rejected as a share; test covers all three.
Imported from Marvisak/VIctory. Originally posted by RVZO6 on 2026-11-26T06:01:41Z.
Closing in favor of #2089, which already fixes
\??\virtual-drive translation in bothfiles.rsandmedia.rs(matching the second-look review on #2416).Pull request closed