HLE media: translate \??\<drive> virtual-drive URLs (fixes #2410) #2414

Closed
pushkarreddyy wants to merge 1 commit from upstream-pr/2416 into main
pushkarreddyy commented 2026-11-25 13:08:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-25T13:08:54Z.


Fixes #2410.

Root Cause

In crates/victory-hle/src/modules/media.rs, local() translates \\?\<drive> paths through files::translate so virtual-drive mounts (such as G: or persistent storage drives) resolve to their host folders. However, the \??\<drive> object-manager branch returned Ok(with_nul(url)) directly without calling files::translate, causing virtual-drive URLs with the \??\ prefix to reach the host Media Foundation resolver untranslated.

Implementation Details

  • Updated the \??\ branch in crates/victory-hle/src/modules/media.rs (local) to construct \\?\{rest} and pass it through files::translate, falling back to with_nul(url) when the drive letter is not a mounted virtual drive.

Verification

  • Added object_prefix_translates_virtual_drives unit test in crates/victory-hle/src/modules/media.rs, mounting a temporary directory and verifying \??\<letter>:\movies\intro.mp4 translates to \\?\...\movies\intro.mp4.
  • Existing local and the_host_reads_those_spellings_as_shares tests pass; CI check is green.

Scope & Limitations

  • Non-virtual \??\<drive> paths (e.g., \??\C:\Windows\a.wav) remain unchanged; \??\UNC\... remains refused.
  • No title files or proprietary assets were used.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6605213219 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-25T13:08:54Z. --- Fixes #2410. ### Root Cause In `crates/victory-hle/src/modules/media.rs`, `local()` translates `\\?\<drive>` paths through `files::translate` so virtual-drive mounts (such as `G:` or persistent storage drives) resolve to their host folders. However, the `\??\<drive>` object-manager branch returned `Ok(with_nul(url))` directly without calling `files::translate`, causing virtual-drive URLs with the `\??\` prefix to reach the host Media Foundation resolver untranslated. ### Implementation Details - Updated the `\??\` branch in `crates/victory-hle/src/modules/media.rs` (`local`) to construct `\\?\{rest}` and pass it through `files::translate`, falling back to `with_nul(url)` when the drive letter is not a mounted virtual drive. ### Verification - Added `object_prefix_translates_virtual_drives` unit test in `crates/victory-hle/src/modules/media.rs`, mounting a temporary directory and verifying `\??\<letter>:\movies\intro.mp4` translates to `\\?\...\movies\intro.mp4`. - Existing `local` and `the_host_reads_those_spellings_as_shares` tests pass; CI `check` is green. ### Scope & Limitations - Non-virtual `\??\<drive>` paths (e.g., `\??\C:\Windows\a.wav`) remain unchanged; `\??\UNC\...` remains refused. - No title files or proprietary assets were used.
catminou4 commented 2026-11-25 14:06:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T13:19:29Z.

Review: COMMENTED


HLE media: ??<drive> virtual-drive URLs translated through files::translate. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058346240 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#pullrequestreview-6058346240). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T13:19:29Z. **Review:** COMMENTED --- HLE media: \??\<drive> virtual-drive URLs translated through files::translate. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
DenRakEiw commented 2026-11-25 14:06:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:19:31Z.

Review: APPROVED


Verified against origin/main (940d32f):

  • Translating \??\<drive> virtual-drive URLs in HLE media (#2410) is clean and well-tested while still refusing network shares.
  • cargo test -p victory-hle media::: 6/6 passed (including object_prefix_translates_virtual_drives).
  • cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6058346792 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#pullrequestreview-6058346792). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T13:19:31Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`): - Translating `\??\<drive>` virtual-drive URLs in HLE media (`#2410`) is clean and well-tested while still refusing network shares. - `cargo test -p victory-hle media::`: 6/6 passed (including `object_prefix_translates_virtual_drives`). - `cargo clippy -p victory-hle --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
pushkarreddyy commented 2026-11-25 14:07:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-25T13:36:19Z.


Hi @Marvisak — this PR resolves #2410 (translating \??\<drive> virtual-drive media URLs via files::translate), with regression tests and CI (check) passing. Ready for review and merge whenever convenient!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164020423 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7164020423). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-25T13:36:19Z. --- Hi @Marvisak — this PR resolves #2410 (translating `\??\<drive>` virtual-drive media URLs via `files::translate`), with regression tests and CI (`check`) passing. Ready for review and merge whenever convenient!
pushkarreddyy commented 2026-11-25 15:04:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-25T14:19:09Z.


Testers on untested Windows 10/11 and Wine/Proton setups are welcome to verify \??\<drive> virtual-drive media playback with this PR.

AI-assisted: yes (Gemini 4 Neon)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165092819 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7165092819). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-11-25T14:19:09Z. --- Testers on untested Windows 10/11 and Wine/Proton setups are welcome to verify `\??\<drive>` virtual-drive media playback with this PR. AI-assisted: yes (Gemini 4 Neon)
Marvisak commented 2026-11-25 16:09:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:28:55Z.


Automated triage for the maintainers.

Merge candidate (worth a look). In media.rs local, the \??\<drive> branch now goes through files::translate the same way the \\?\<drive> branch already did, so a URL on a mounted virtual drive reaches its host folder and other drives fall back to the URL unchanged. This does not loosen any offline guard: the drive check and the UNC refusal are untouched. Optional: the new test checks only the prefix and suffix of the result; creating the file and reading it back, as the existing virtual-drive test in the module does, would be stronger. CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166910056 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7166910056). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:28:55Z. --- <!-- victory-triage v1 head=e67c346a46dae54d9b32143fd5ec07a91e0aa913 verdict=merge-candidate at=2026-11-25T15:30:00Z --> Automated triage for the maintainers. **Merge candidate (worth a look).** In `media.rs` `local`, the `\??\<drive>` branch now goes through `files::translate` the same way the `\\?\<drive>` branch already did, so a URL on a mounted virtual drive reaches its host folder and other drives fall back to the URL unchanged. This does not loosen any offline guard: the drive check and the UNC refusal are untouched. Optional: the new test checks only the prefix and suffix of the result; creating the file and reading it back, as the existing virtual-drive test in the module does, would be stronger. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 23:04:29 +00:00
Marvisak commented 2026-11-25 23:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:09:21Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing in favour of #2089, which fixes the same thing at the root, in the shared files::translate, so every path-taking file API is covered as well as this media branch; the two edit the same lines of media.rs. The change here reads correct and does not loosen the offline guard.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176005975 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7176005975). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:09:21Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing in favour of #2089, which fixes the same thing at the root, in the shared `files::translate`, so every path-taking file API is covered as well as this media branch; the two edit the same lines of `media.rs`. The change here reads correct and does not loosen the offline guard. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2414
No description provided.