HLE: reach the ConsoleMode overrides through kernelbase.dll #2285
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!2285
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2285/head"
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?
@Calvix2k on GitHub · 2026-11-25 09:48 UTC · original
Calvix2k:codex/hle-consolemode-kernelbase-2140→main· +36 −1 · 1 files · 1 commits · closed without mergingFixes #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.The emulated `ConsoleMode` value is served by `device_type`'s registry functions, which were listed only for `advapi32.dll` and the registry API set. On Windows the API set and `GetModuleHandleW("kernelbase.dll")` both give `kernelbase.dll`, and the host policy lets that DLL through, so a title importing (or GetProcAddress-ing) the registry calls by that name got the host's own functions: the read went to the host registry, found no value, and the title saw a PC instead of the chosen console. List `kernelbase.dll` with the other modules that point it out next to their API sets (kernel, files). Test: an `HleResolver` with no host pass-through classifies `RegOpenKeyExW`, `RegQueryValueExW` and `RegCloseKey` as HLE from `kernelbase.dll`, `advapi32.dll` and the API set name; without the list entry the test fails on the first `kernelbase.dll` lookup.@Marvisak on GitHub · 2026-11-25 13:33 UTC · original
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
@Calvix2k on GitHub · 2026-11-25 16:09 UTC · original
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.
@Calvix2k on GitHub · 2026-11-25 16:28 UTC · original
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