Media: a share is refused however it is spelled #207
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!207
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/207/head"
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?
@Maraco91 on GitHub · 2026-11-24 01:25 UTC · original
Maraco91:media/unc-forms-are-not-local→main· +103 −5 · 1 files · 1 commits · merged 2026-11-25 00:08 UTCWhat
The source-resolver proxy lets a title open local files only (
local()), so that Media Foundation cannot fetch over the network pastmodules::net. It recognises a share as\server\..,//server/..orfile://server/... The host recognises more spellings, and these went through to the host's resolver unchanged:local()onmain/\server\share\a.mp4,\/server/share/a.mp4\server\share\a.mp4(GetFullPathNameW)\??\UNC\server\share\a.mp4\?\UNC\..; the host's file calls take the prefix as it isfile:////server/share/a.mp4,file://///server/..\server\share\a.mp4(PathCreateFromUrlW)file:\server\share\a.mp4,file:/%5Cserver/share/a.mp4\server\share\a.mp4file:///%5C%5Cserver/share/a.mp4\\server\share\a.mp4Now refused, naming the server, like the spellings already known:
\??\followed by anything but a drive (the rule\?\already has);file:URL that names no host and whose decoded path starts with two separators and is not a drive path.Unchanged, and checked:
\movies\a.mp4andfile:///movies/a.mp4(one separator),file:////C:/Windows/a.wav(a drive after the slashes: stillC:\Windows\a.wav),\??\C:\.., andfile://localhost//server/share/a.mp4, which the host reads as the local\server\share\a.mp4.What I could not check: that Media Foundation's own resolver reads
file:URLs the wayPathCreateFromUrlWdoes (it would take a share to test against). I have not seen a title pass such a URL (I have no game files); this closes spellings the rule's own contract says are refused.Tested
Windows 11 Pro 10.0.26200, rustc 1.98.1 (
x86_64-pc-windows-msvc), no game data, no GPU, no network involved (all checks are on strings).Two new unit tests over one list of spellings:
the_host_reads_those_spellings_as_shares(Windows only) pins down the right-hand column above on the host:std::path::absolutefor the two path forms,PathCreateFromUrlWfor the five URLs, that a\??\path opens (\??\%SystemRoot%), and the local reading of the three URL controls. It passes onmainand with the fix: it is the reference, not the fix's test.shares_are_refused_however_they_are_spelledcheckslocal()refuses all eight, with the scheme and server it reports, and that the five local look-alikes pass as before.Results:
main(d2a4bae) + the tests only:cargo test -p victory-hle --lib media:::shares_are_refused_however_they_are_spelledfails (/\server\share\a.mp4:left: Ok("/\server\share\a.mp4"),right: Err(("unc", "server"))); the host reference passes.cargo clippy -p victory-hle --tests: nothing inmedia.rs.rustfmt --check media.rs: clean.cargo xtask policy --staged: ok.Not tested: a title run; a real share.
#31 touches the COM release counts in this file, not
local().AI-assisted (Claude Code); the tests above were run on the machine described.
🤖 Generated with Claude Code
@jeremygold02 on GitHub · 2026-11-24 04:55 UTC · original
Thanks @Maraco91 for adding coverage around share paths that can be disguised by their spelling.
I tested commit
11ca3ce4928cf9ac2f77fcdc1c095d41c62fcbcewith:Both targeted tests passed (2 passed, 0 failed; 86 filtered):
shares_are_refused_however_they_are_spelledrejects three UNC path spellings and fivefile:URL variants as server shares, while checking that similar local paths and localhost URLs remain accepted.the_host_reads_those_spellings_as_shareschecks Windows path normalization andPathCreateFromUrlWresults for those URL forms, plus local-path cases.This verifies the tested path classification and host URL conversion cases. It does not open a real remote share or exercise media playback.