HLE media: translate \??\<drive> paths through the virtual drives #3273

Open
github-bot wants to merge 1 commit from github-bot/gh-3273 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 15:23 UTC · original
andrewpozdnakov7-jpg:fix/2410-media-drive-path → main · +14 −2 · 1 files · 1 commits · open

media::local handles \\?\<drive> by letting the path reach files::translate, but the \??\<drive> spelling returned early with the title's URL unchanged. A title that opens a media file as \??\G:\video.mp4 handed 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.wav still comes back exactly as given.

  • New case in media tests: \??\<letter>:\movies\intro.mp4 reads the file from the mounted folder, next to the existing \\?\ and file: 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.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 15:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/3273) `andrewpozdnakov7-jpg:fix/2410-media-drive-path` → `main` · +14 −2 · 1 files · 1 commits · open `media::local` handles `\\?\<drive>` by letting the path reach `files::translate`, but the `\??\<drive>` spelling returned early with the title's URL unchanged. A title that opens a media file as `\??\G:\video.mp4` handed 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.wav` still comes back exactly as given. - New case in `media` tests: `\??\<letter>:\movies\intro.mp4` reads the file from the mounted folder, next to the existing `\\?\` and `file:` 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:25:20 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 15:27 UTC · original · approved these changes

Reviewed the diff and verified locally on Windows 11 x64:

  • Translating \??\<drive> paths via files::translate(&wide) while preserving untranslated host-drive paths via unwrap_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 (including only_local_files_reach_the_host covering \??\<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).

**@⁠Dukestar69** on GitHub · 2026-11-26 15:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3273#pullrequestreview-6076743201) · **approved these changes** Reviewed the diff and verified locally on Windows 11 x64: - Translating `\??\<drive>` paths via `files::translate(&wide)` while preserving untranslated host-drive paths via `unwrap_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 (including `only_local_files_reach_the_host` covering `\??\<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).
Author
Owner

@⁠AurumCarlos on GitHub · 2026-11-26 15:27 UTC · original · reviewed

The change is correct: rest takes the same files::translate path as plain drive paths, and a host drive keeps the title's \??\ spelling.

But #2089 (still open) already fixes \??\ virtual-drive translation, in both media.rs and files.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.

**@⁠AurumCarlos** on GitHub · 2026-11-26 15:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3273#pullrequestreview-6076753355) · **reviewed** The change is correct: `rest` takes the same `files::translate` path as plain drive paths, and a host drive keeps the title's `\??\` spelling. But #2089 (still open) already fixes `\??\` virtual-drive translation, in both `media.rs` and `files.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.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3273/head:github-bot/gh-3273'
git switch 'github-bot/gh-3273'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3273'
git switch 'github-bot/gh-3273'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3273'
git switch 'github-bot/gh-3273'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3273'
git switch 'main'
git merge --squash 'github-bot/gh-3273'
git switch 'main'
git merge --ff-only 'github-bot/gh-3273'
git switch 'main'
git merge 'github-bot/gh-3273'
git push origin 'main'
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!3273
No description provided.