HLE: registry lookups through kernelbase.dll miss the emulated ConsoleMode key #2138
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?
Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T05:54:39Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:47:38Z.
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