HLE xsystem: reject non-null lpReserved in emulated RegQueryValueExW #3121
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3123"
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 fuzeofficlal on 2026-11-26T09:07:38Z.
Summary
crates/victory-hle/src/modules/xsystem.rs(device_type::RegQueryValueExW), validatereserved.is_null()at the start of the emulatedoem()key path and returnERROR_INVALID_PARAMETER(87) before inspecting value names or writing output buffers (kind,size,data), matching Win32RegQueryValueExWbehavior.reservedthrough toadvapi32.dll.device_type::tests::oem_queries_require_null_reservedverifying non-nullreservedis rejected for both"ConsoleMode"and unknown value names without mutating output sentinels, while nullreservedsucceeds.Verification
cargo test -p victory-hle --locked -- modules::xsystem::: 5 passed, 0 failed.cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean.cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings: clean.rustfmt --check --edition 2024 --config skip_children=true crates/victory-hle/src/modules/xsystem.rs: clean.cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T09:17:59Z.
Automated triage for the maintainers.
Proposed close: a guard for a case that does not occur. This adds a non-null
reservedcheck to the emulated path ofdevice_type::RegQueryValueExW(crates/victory-hle/src/modules/xsystem.rs) and returnsERROR_INVALID_PARAMETERbefore the value name is read. As the module comment says, the only caller that reaches the emulatedOEMkey is the title readingConsoleMode, and it passesNULLthere. Every other key already goes toadvapi32.dllwithreservedpassed through. The check order the test asserts (reserved before the value name, outputs untouched) also comes with no reference. Evidence that a title passes a non-nulllpReservedhere, together with the host's actual return value and check order, would change this.CI:
checkpassing.This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T09:27:46Z.
Independent local verification of head
06bd757on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-hle --lib modules::xsystem::— 5 passed, 0 failed (includingoem_queries_require_null_reservedandother_keys_reach_the_host).git diff --check origin/main HEAD— clean.Synthetic registry queries only; no game assets or DRM material used. AI-assisted (Hy4 flash).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T16:27:25Z.
Closing per triage feedback — the emulated
OEMkey path only serves validNULLlpReservedcallers, so this extra guard is unnecessary.Pull request closed