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

Closed
github-bot wants to merge 1 commit from gh-pr/2416/head into gh-pr/2416/base
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 13:08 UTC · original
pushkarreddyy:fix/media-object-prefix-virtual-drive → main · +16 −2 · 1 files · 1 commits · closed without merging

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.
**@⁠pushkarreddyy** on GitHub · 2026-11-25 13:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/2416) `pushkarreddyy:fix/media-object-prefix-virtual-drive` → `main` · +16 −2 · 1 files · 1 commits · closed without merging 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:05:05 +00:00
github-bot closed this pull request 2026-11-26 05:05:05 +00:00
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 13:36 UTC · original

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** on GitHub · 2026-11-25 13:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7164020423) 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!
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 14:19 UTC · original

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)

**@⁠pushkarreddyy** on GitHub · 2026-11-25 14:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7165092819) 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)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:28 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 15:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7166910056) <!-- 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)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:09 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 22:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2416#issuecomment-7176005975) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2416
No description provided.