HLE xsystem: reject non-null lpReserved in emulated RegQueryValueExW #3123
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!3123
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fuzeofficlal on GitHub · 2026-11-26 09:07 UTC · original
fuzeofficlal:fix/hle-xsystem-regquery-reserved→main· +47 −0 · 1 files · 1 commits · closed without mergingSummary
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.@Marvisak on GitHub · 2026-11-26 09:17 UTC · original
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
@cloph-dsp on GitHub · 2026-11-26 09:27 UTC · original
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).
@fuzeofficlal on GitHub · 2026-11-26 16:27 UTC · original
Closing per triage feedback — the emulated
OEMkey path only serves validNULLlpReservedcallers, so this extra guard is unnecessary.Pull request closed