Media: a share is refused however it is spelled #207
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/207"
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 Maraco91 on 2026-11-24T01:25:32Z.
What
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
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:55:17Z.
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.