victory-hle: reject non-null reserved in OEM RegQueryValueExW (#3123) #3407
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T22:48:41Z.
Depends 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.
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T23:02:13Z.
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.Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-26T23:03:21Z.
Review: COMMENTED
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.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T23:13:31Z.
Review: APPROVED
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.)Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T01:28:08Z.
Review: APPROVED
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.