Repository navigation
Conversation
GetConsoleType returned xcl.toml's console_type_raw, written as 6 by
default, whatever device_type said. In the kernel's order (Xbox One 1 ...
One X devkit 4, Lockhart 5, Anaconda 6) 6 is a Series X, so under
XCL_DEVICE_TYPE=lockhart the title was told a Series S by the registry
and XSystemGetDeviceType and a Series X by GetConsoleType. A lockhart
test run still made many 3840x2160 render targets.
The written default (6, or 0) now follows device_type: 5 on a Series S,
6 on a Series X. Any other configured value was set on purpose and is
kept. XCL_CONSOLE_TYPE_RAW=<n> forces a value over everything.
XCL_CONSOLE_TYPE_FOLLOW=0 returns xcl.toml's value as before. The value
is decided once and logged ("kernelx: GetConsoleType -> 5 (...)"), as is
the switch. 5 is inferred from the kernel's order, not documented.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GDK thunk behind XSystemGetDeviceType reads HKLM\...\OEM ConsoleMode. XCL answered it only through RegOpenKeyW, RegOpenKeyExW, RegQueryValueExW and RegCloseKey, the functions seen so far. A thunk that uses RegGetValueW or the A functions reached the PC registry, found no OEM key and was told "PC", whatever XCL_DEVICE_TYPE said. RegGetValueW/A, RegOpenKeyExA, RegOpenKeyA and RegQueryValueExA now give the same answer. RegGetValue follows Windows' rules: RRF_RT_* must allow a REG_DWORD (else ERROR_UNSUPPORTED_TYPE), data without a size is ERROR_INVALID_PARAMETER, a small buffer gets ERROR_MORE_DATA and the size, RRF_ZEROONFAILURE zeroes the buffer on failure, and a subkey of the OEM handle or another value name is ERROR_FILE_NOT_FOUND. Every other key and value goes to the real registry. RegCloseKey already accepts the OEM handle. The functions are routed through advapi32, advapi32legacy and the api-ms-win-core-registry API sets. XCL_CONSOLE_TYPE_FOLLOW=0 (logged once with the GetConsoleType change) makes the new hooks forward everything, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (head 57f41be, diff read, not a merge-check; checks red):
Fine (by reading):
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
Requested by Prime
With
XCL_DEVICE_TYPE=lockhart(Series S), the registry andXSystemGetDeviceTypetold the title it ran on a Series S, butGetConsoleTypereturnedconsole_type_rawfrom xcl.toml, which is written as 6 by default whateverdevice_typesays. In the kernel's order (Xbox One 1 ... One X devkit 4, Lockhart 5, Anaconda 6) 6 is a Series X, so the title was told both. In a Series S test run on an RTX 3060 Ti the title still made many 3840x2160 render targets. Also, the GDK thunk behindXSystemGetDeviceTypereadsHKLM\...\OEMConsoleMode, and XCL answered it only throughRegOpenKeyW,RegOpenKeyExWandRegQueryValueExW; a thunk that usedRegGetValueWor the ANSI functions reached the PC registry and was told "PC". Now the written default (6, or 0) followsdevice_type: 5 on a Series S, 6 on a Series X. Any other configured value is kept.RegGetValueW/A,RegOpenKeyExA,RegOpenKeyAandRegQueryValueExAgive the sameConsoleModeanswer as the W functions. The value 5 is inferred from the kernel's order, not documented.Related: #3564 documents
XCL_DEVICE_TYPEin the README; this change makesGetConsoleTypeagree with it.What is in it
crates/xcl/src/hle/kernelx.rs:GetConsoleTypefollowsdevice_typefor the written default (decided once and logged);RegGetValueW/A,RegOpenKeyExA,RegOpenKeyAandRegQueryValueExAanswer the OEM key'sConsoleModewith Windows' rules for flags, buffer size,RRF_ZEROONFAILUREand unknown values; every other key goes to the real registry. Unit tests for both.crates/xcl/src/config.rs: theconsole_type_rawdoc comment says how the value is chosen now.crates/xcl/src/resolver.rs: a test that the new functions resolve to kernelx through advapi32, advapi32legacy and theapi-ms-win-core-registryAPI sets.Two commits: the
GetConsoleTypechange, then the registry functions on top of it.Tested
cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnupasses. The test suite was not run on this exact branch.Regression run
Not tested
scripts/smoke.ps1on this branch; AMD.RegGetValueWor the ANSI functions: we have only seen the W functions used.Switches
XCL_CONSOLE_TYPE_FOLLOW(default on):=0makesGetConsoleTypereturn xcl.toml'sconsole_type_rawas before, and the new registry hooks forward everything to the PC registry.XCL_CONSOLE_TYPE_RAW=<n>(default unset; decimal or 0x hex):GetConsoleTypereturns<n>over everything.AI use
🤖 Generated with Claude Code