HLE: reopen the emulated OEM key on a null or empty subkey #1431

Closed
github-bot wants to merge 1 commit from gh-pr/1431/head into gh-pr/1431/base
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 17:58 UTC · original
fuzeofficlal:fix/hle-regopen-oem-empty-subkey-765 → main · +70 −2 · 1 files · 1 commits · closed without merging

Fixes #765.

Summary

  • Handle null or empty ("") subkeys on the emulated oem() registry handle in xsystem::device_type::open: return ERROR_INVALID_PARAMETER (87) when out is null, otherwise write oem() and return ERROR_SUCCESS (0).

Verification

  • Added null_or_empty_subkey_reopens_the_oem_key covering RegOpenKeyW and RegOpenKeyExW with NULL / L"" subkeys, null output pointers, RegCloseKey safety on the reopened handle, and non-empty subkey FILE_NOT_FOUND.
  • cargo test --workspace, cargo clippy --workspace --all-targets --all-features, and cargo xtask policy: passed.
**@⁠fuzeofficlal** on GitHub · 2026-11-24 17:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/1431) `fuzeofficlal:fix/hle-regopen-oem-empty-subkey-765` → `main` · +70 −2 · 1 files · 1 commits · closed without merging Fixes #765. ### Summary - Handle null or empty (`""`) subkeys on the emulated `oem()` registry handle in `xsystem::device_type::open`: return `ERROR_INVALID_PARAMETER` (`87`) when `out` is null, otherwise write `oem()` and return `ERROR_SUCCESS` (`0`). ### Verification - Added `null_or_empty_subkey_reopens_the_oem_key` covering `RegOpenKeyW` and `RegOpenKeyExW` with `NULL` / `L""` subkeys, null output pointers, `RegCloseKey` safety on the reopened handle, and non-empty subkey `FILE_NOT_FOUND`. - `cargo test --workspace`, `cargo clippy --workspace --all-targets --all-features`, and `cargo xtask policy`: passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:31:29 +00:00
github-bot closed this pull request 2026-11-26 04:31:29 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 21:06 UTC · original

Tested on Windows 11 with the repo toolchain, merged into current main (ffe310e):

cargo test -p victory-hle passed failed ignored
main 95 0 0
main + this PR 96 0 0
  • The new test passes.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/1431#issuecomment-7144496596) Tested on Windows 11 with the repo toolchain, merged into current `main` (ffe310e): | `cargo test -p victory-hle` | passed | failed | ignored | |---|---|---|---| | `main` | 95 | 0 | 0 | | `main` + this PR | 96 | 0 | 0 | - The new test passes. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:27 UTC · original

Automated triage for the maintainers.

Needs work. device_type::open in crates/victory-hle/src/modules/xsystem.rs now reopens the emulated OEM key when the subkey is null or empty, and returns 87 when the output pointer is null. This matches Microsoft's documentation for RegOpenKeyW/RegOpenKeyExW, and CI passes. However, the module comment and issue #765 both say the title only opens the full path and reads ConsoleMode, so nothing in the title reaches this path. Please show where the title, or code linked into it, reopens this key with a null or empty subkey. Without such a caller this is completeness for an unreachable case.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1431#issuecomment-7151931306) <!-- victory-triage v1 head=04b68eea6043ece42b9d7cd758c9295bd39e0674 verdict=needs-work at=2026-11-25T03:28:20Z --> Automated triage for the maintainers. **Needs work.** `device_type::open` in `crates/victory-hle/src/modules/xsystem.rs` now reopens the emulated OEM key when the subkey is null or empty, and returns 87 when the output pointer is null. This matches Microsoft's documentation for `RegOpenKeyW`/`RegOpenKeyExW`, and CI passes. However, the module comment and issue #765 both say the title only opens the full path and reads `ConsoleMode`, so nothing in the title reaches this path. Please show where the title, or code linked into it, reopens this key with a null or empty subkey. Without such a caller this is completeness for an unreachable case. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 04:32 UTC · original

Agreed with the triage note — there is no observed caller reopening the ConsoleMode OEM handle with a null or empty subkey, so keeping device_type::open minimal is cleaner. Closing this PR.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 04:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1431#issuecomment-7152941604) Agreed with the triage note — there is no observed caller reopening the `ConsoleMode` OEM handle with a null or empty subkey, so keeping `device_type::open` minimal is cleaner. Closing this PR.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1431
No description provided.