hle: translate \??\ object-manager paths onto virtual drives #2087
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2089"
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 Pradhyumna51 on 2026-11-25T04:34:48Z.
Commit
11ca3cetaughtmedia::localto accept the\??\object-manager prefix so shares under\??\UNC\...stay blocked, while returning\??\X:...paths directly beforefiles::translatecould rewrite them. Meanwhile,files::translateandfiles::narrowonly checked for\\?\, leaving\??\X:\...paths unmapped in both the file APIs and Media Foundation path resolution.files::translateandfiles::narrownow recognize\??\alongside\\?\, stripping a verbatim\\?\prefix from the mounted host root or rewriting a\\server\shareroot toUNC\server\sharewhen\??\is used.media::localnow passes local\??\X:...paths throughfiles::translate.Verified locally with
cargo +stable-x86_64-pc-windows-gnu test -p victory-hle --locked --lib -- --test-threads=1(144 passed, 0 failed) andcargo +stable-x86_64-pc-windows-gnu xtask policy(182 files ok).Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:41:38Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-hle --lib files::— 7 passed, 0 failed (includingobject_prefix_paths_reach_the_host_folder)cargo clippy -p victory-hle --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean translation of
\??\object-manager paths onto virtual drives with unit test coverage. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:02:19Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
??\ object-manager paths translated onto virtual drives — path canonicalization for drive-letter-less NT paths; matches how titles open files via object manager.
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T04:42:51Z.
I ran CreateFileA and CreateFileW through the synthetic conformance title from #2057 (
637ba6f), before and after applying the runtime diff from84ed850. Each check opened the same mounted ASCII file withGENERIC_READandOPEN_EXISTINGand compared the bytes read against the fixture.G:\conformance.txt\\?\G:\conformance.txt\??\G:\conformance.txtINVALID_HANDLE_VALUE, last error 3The other 152 checks gave identical results in both runs (147 passed, 5 failed). This exercises guest file reads on a local virtual drive. Media paths and native Windows behavior were outside this test.
AI-assisted testing and review.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:46:05Z.
Triage verdict — Keep the virtual-drive fix, preserve original wide paths (
84ed850)Evidence
11ca3ce. The old Media Foundation branch handed the original UTF-16 units through unchanged. This version classifies a lossy string and reconstructs the host path from it, so an unmapped native path can lose original code units. Media classification and fallbackChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Pradhyumna51 on 2026-11-25T04:50:39Z.
Updated
media::localin6df6d10to passCow::Borrowed(url)directly for drive,\\?\, and\??\paths rather than re-encoding wide units from the lossy classification string, while keepingfile:URL percent-decoding owned. Both virtual-drive translation and unmapped fallbacks now preserve arbitrary UTF-16 code units unchanged.Added unit assertions in
only_local_files_reach_the_hostfor an unpaired surrogate on both an unmapped\??\C:\path and a mounted\??\drive, and verified withcargo +stable-x86_64-pc-windows-gnu test -p victory-hle --locked --lib -- --test-threads=1(144 passed, 0 failed) andcargo +stable-x86_64-pc-windows-gnu xtask policy(182 files ok).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:34:05Z.
Automated triage for the maintainers.
files::translateandfiles::narrow(modules/files.rs) now accept the\??\prefix as well as\\?\, so\??\X:\...reaches a virtual drive. A\\?\or\\server\shareroot is rewritten correctly under a prefix, which also fixes the\\?\prefix with a verbatim root.media::local(modules/media.rs) sends local\??\X:paths throughtranslateand passes the original UTF-16 units through instead of a lossy re-encoding. I checked that the share and UNC rejections inlocalare unchanged. Unmapped\??\C:paths reach the host exactly as before, so the media guards are not loosened. Tests cover the mapping, a verbatim-root mount and unpaired surrogates. A contributor's conformance run shows\??\G:opens failing before and passing after. CI: passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:41:42Z.
Code review and Windows 11 verification at head
6df6d100d1e3merged ontomain(63bcca43c6a0):The
\??\prefix support andCow::Borrowed(url)surrogate preservation inmedia.rslook useful (xtask policy191 ok,clippy0 warnings,victory-hle155/155 passed), though three path edge cases and a merge conflict with#1772are worth addressing:./..skipped for\??\and\\?\paths (crates/victory-hle/src/modules/files.rs:167):verbatim()is only invoked whenprefix.is_empty() && root.len() + tail.len() >= LONG, so any\??\(or\\?\) path skipsverbatim()entirely. While/is converted to\,.and..in\??\X:\a\..\bremain unnormalized (and Windows object-manager / verbatim paths do not normalize..).files.rs:186):root(as#1772does), a mount atC:\with input\??\X:produces\??\C:\\.media.rs:66trim_start_matches("UNC\\")is case-sensitive, andGetDiskFreeSpaceW(files.rs:431) does not yet extract a volume root for\??\paths.#1772: Both PRs modifytranslate()infiles.rs(git mergeconflicts). Rebasing onto#1772would resolve the conflict and inheritverbatim()normalization andvolume_rootcleanly.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.