victory-hle: reject non-null reserved in OEM RegQueryValueExW (#3123) #3407
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!3407
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3407"
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?
@cloph-dsp on GitHub · 2026-11-26 22:48 UTC · original
cloph-dsp:fix/xsystem-reserved-guard→main· +38 −0 · 1 files · 1 commits · openDepends on: #1633
Fixes the closed-unmerged #3123 item: the emulated
RegQueryValueExWon the OEM device-type key accepted a non-nulllpReserved, which Windows rejects withERROR_INVALID_PARAMETER.Change (1 file, victory-hle/src/modules/xsystem.rs): after the non-OEM host-forward branch, return
INVALID_PARAMETER(87) whenreservedis non-null. Addedmodules::xsystem::device_type::tests::oem_queries_require_null_reserved, which checks non-null reserved is rejected for bothConsoleModeand an unknown value name with output sentinels unchanged.Validation (Windows, Rust 1.100.0/MSVC,
cargo test --locked,CARGO_BUILD_JOBS=2, per-worktreeCARGO_TARGET_DIR): exact test passes,git diff --checkclean, negative control: test absent onorigin/main.AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only synthetic test). No game data used.
@Jackster on GitHub · 2026-11-26 23:02 UTC · original
Windows 11,
63bcca4+ this PR:cargo test -p victory-hle: lib 153 passed / 0 failed (unpatched63bcca4here: 152), plus the integration suite (1 passed).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.The added test
oem_queries_require_null_reservedpasses; it is the only change and the rest of the module's tests are unchanged. Synthetic only. AI-assisted.@AurumCarlos on GitHub · 2026-11-26 23:03 UTC · original · reviewed
This brings back the change from #3123, which was closed after the maintainer triage marked it "proposed close: a guard for a case that does not occur" (the emulated OEM key only serves the title's own calls, which pass
NULL). fuzeofficlal closed it on that basis.Unless there's new evidence, such as a title passing a non-null
lpReservedthere or a call path that triage missed, this is likely to be closed for the same reason. If you have that evidence, please quote it in the description and answer the triage note directly.@fuzeofficlal on GitHub · 2026-11-26 23:13 UTC · original · approved these changes
LGTM! Verified locally with
rustfmt --edition 2024 --check,cargo clippy --locked -p victory-hle --all-targets -- -D warnings,cargo xtask policy, andcargo test --locked -p victory-hle --lib modules::xsystem::(5/5 passed).device_type::RegQueryValueExW(crates/victory-hle/src/modules/xsystem.rs:234-236) cleanly returnsERROR_INVALID_PARAMETER(87) for any non-nulllpReservedon the synthetic OEM handle before inspectinglpValueNameor touchinglpType/lpData/lpcbData, while continuing to forwardlpReservedtoadvapi32.dllfor host handles.(Minor non-blocking note: in
oem_queries_require_null_reserved,sizestarts at4, which matches theDWORDbyte count, so a different sentinel like0oru32::MAXwould also catch unintended writes tolpcbData.)@Dukestar69 on GitHub · 2026-11-27 01:28 UTC · original · approved these changes
LGTM — verified on Windows:
lpReservedwithERROR_INVALID_PARAMETERbefore checking the value name matches Win32RegQueryValueExWsemantics cleanlycargo test -p victory-hle --lib xsystempassed (5/5, includingoem_queries_require_null_reserved)cargo clippy -p victory-hle --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (191 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.