HLE: registry lookups through kernelbase.dll miss the emulated ConsoleMode key #2140
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#2140
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@BastienRodz on GitHub · 2026-11-25 05:54 UTC · original
What happens
The emulated
HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM\ConsoleModevalue (xsystem::device_type, 0x64 for Series X, 0x60 for Series S) is only reached when the title bindsRegOpenKeyExW/RegQueryValueExW/RegCloseKeythroughadvapi32.dllor anapi-ms-win-core-registry-*import.device_type::module()lists:kernelbase.dllis missing, while the host policy letskernelbase.dllthrough (host.rs) andkernel::module()/files::module()both list it next to their API sets.That matters for lookups by name.
GetProcAddresson a host module goes throughkernel::host_override, which asks the registry with the host module's file name. On Windows the registry API set (LoadLibraryW("api-ms-win-core-registry-l1-1-0.dll")) andGetModuleHandleW("kernelbase.dll")both givekernelbase.dll, soregistry::lookup("kernelbase.dll", "RegOpenKeyExW")misses and the title gets the host's ownRegOpenKeyExW. TheConsoleModeread then goes to the host registry, which has no such value: the title sees a PC instead of the chosen console. A direct import fromkernelbase.dllresolves to the host the same way (HleResolver::classifyreturnsHost).Expected
Registry lookups through
kernelbase.dll, by import or byGetProcAddress, reach the device-type overrides, as they already do throughadvapi32.dlland the API set name.Where
crates/victory-hle/src/modules/xsystem.rs,device_type::module().AI-assisted (Gemini 4 Neon found it, Claude Code reviewed and verified it); synthetic test only, no game data.
@Marvisak on GitHub · 2026-11-25 15:47 UTC · original
Automated triage for the maintainers.
Confirmed on main (
da82e44):device_type::module()incrates/victory-hle/src/modules/xsystem.rslists onlyadvapi32.dllandapi-ms-win-core-registry-*, whilehost_overrideincrates/victory-hle/src/modules/kernel.rslooks overrides up by the host module's file name (kernelbase.dllfor the registry API set), so those lookups miss theConsoleModeoverride. Open PRs addressing it: #2141, #2285, #2343.Generated by Claude Code