HLE: reach the ConsoleMode overrides through kernelbase.dll #2283
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2285"
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 Calvix2k on 2026-11-25T09:48:14Z.
Fixes #2140.
Problem
The emulated
HKLM\…\OEM\ConsoleModevalue is served bydevice_type's registry functions, listed only foradvapi32.dllandapi-ms-win-core-registry-*. On Windows the registry API set loads askernelbase.dll, and the host policy letskernelbase.dllthrough, so a title that imports the registry calls from that DLL (or reaches them throughGetProcAddresson it) got the host's functions: the read went to the host registry, which has noConsoleMode, and the title saw a PC instead of the chosen console.Change
device_type::modulelistskernelbase.dllnext to the API set, askernelandfilesalready do.Verification
New
the_console_mode_lookups_are_reached_through_kernelbase: anHleResolverwithHostPolicy::none()classifiesRegOpenKeyExW,RegQueryValueExWandRegCloseKeyasHlefromkernelbase.dll,advapi32.dllandapi-ms-win-core-registry-l1-1-0.dll.kernelbase.dllentry (checked by removing it locally): fails onkernelbase.dll!RegOpenKeyExW(NonevsSome(Hle)), so the test catches exactly this.cargo test -p victory-hle: 144 lib tests pass; clippy-D warningsclean;cargo xtask policy1 file ok. No game data.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T10:02:43Z.
Review: APPROVED
Verified against
origin/main(940d32f):kernelbase.dlltodevice_type::module()ensuresRegOpenKey*/RegQueryValueExW/RegCloseKeyimports resolved throughkernelbase.dllstill hit theConsoleModeoverrides.cargo test -p victory-hle xsystem: 5/5 passed (includingthe_console_mode_lookups_are_reached_through_kernelbase).cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:06Z.
Review: COMMENTED
HLE: ConsoleMode registry overrides reachable through kernelbase.dll (API set name titles may import by). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Includes a PE-import-level test — good coverage for the shim path.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:33:39Z.
Automated triage for the maintainers.
Proposed close: duplicate of #2141. This PR adds
kernelbase.dlltodevice_type::module().dllsincrates/victory-hle/src/modules/xsystem.rsso the ConsoleMode registry overrides are reached through that DLL. The change is correct, but #2141 (opened earlier, also "Fixes #2140", merges cleanly, CI passing) makes the identical one-line change, and its test goes further: besidesHleResolver::classify, it checks thatGetProcAddressonkernelbase.dlland on the registry API set returns our functions and reads the chosen ConsoleMode through them. CI (check) passes here too. If something in this PR is not covered by #2141, a review comment there would be the best place for it.This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T16:09:15Z.
Closing as a duplicate of the earlier #2141, as the triage proposes: the identical one-line change, with a test that goes further (GetProcAddress through the API set too). No objection to #2141 going in.
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T16:28:54Z.
Closing as a duplicate of the earlier #2141, as the triage proposes: the identical one-line change, with a test that goes further (
GetProcAddressthrough the API set too). No objection to #2141 going in.Pull request closed