runtime: GameInput v0 call contract of the main executable (static caller evidence, fixture first) #1056
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1056
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?
@lukaslw-lab on GitHub · 2026-11-23 23:37 UTC · original
AI-assisted (Claude Code).
The main executable imports one GameInput entry, by ordinal, and treats a failed call as fatal. Today
pe_map --systembindsGameInput.dllto the desktop System32 DLL with no check, which is why it doesn't appear among the 22 missing externals in the #870 checkpoint. This issue records the caller-side contract and tracks a fixture-only check.Evidence. Static reading of a local copy of the main executable; nothing executed. ABI shapes and counts only. "Observed" is read from the caller's code. The right column maps it onto the public v0 header (Windows SDK 10.0.26100
um/GameInput.h, Microsoft Learn); it is an interpretation, not confirmed for the console runtime.GameInput.dllordinal 1, called with one pointer argument; negative result → breakpointGameInputCreate(IGameInput**); the GDK header gives v0 (build stamps in the executable show an April 2026 GDK)atexithandlerGetCurrentReading,GetNextReading,GetPreviousReading,RegisterDeviceCallback,UnregisterCallback,FindDeviceFromIdGetKeyCount,GetKeyState,GetGamepadStateGetDeviceInfo(deviceId),SetRumbleState(motors only, no trigger rumble)0x40000and0x10; status filter1; enumeration2; unregister timeouts5000andUINT64_MAX0x1–0x2000of the gamepad's first word tested, none aboveWhat a provider has to satisfy (from the caller's code):
scanCode & 0xE000 == 0xE000and accepts right Shift as virtual key 0 with scan code0xE036.DefWindowProc, so keyboard input arrives only through GameInput.Not established: the console runtime's actual behavior (callback thread, scan-code encoding, history depth); which thread polls and how often (the polls run from the title's own virtual update methods and task callbacks; static analysis stops there); anything about the desktop runtime.
Plan (fixture-only, following #1047): a source-built caller with the call shapes above and a test-only recording
gameinput.dllexporting ordinal 1 only, under the Windows loader andpe_map,devandrelease. Controls: failed create reaches the fatal path; withheld export stopspe_mapbefore entry; a two-argument or wrong-ordinal provider, a callback delivered on another thread with a wait, a non-zero rumble tail or a wrong 28-byte layout are each caught. No production export. A comparison against the desktop in-box runtime follows separately, labelled as desktop evidence.Question: is a test-only provider the right first step here, and should the by-ordinal System32 binding be pinned by a test? Whether production later forwards to the desktop runtime or implements the subset is a separate decision.
Related: #870, #908 (import inventory lists the ordinal-1 import), #1047.
@Holastor on GitHub · 2026-11-23 23:44 UTC · original
I'll take this slice: source-built caller fixture and test recording provider for
gameinput.dll!#1(GameInputCreate).gameinput.dllordinal 1 export,GameInputCreate(IGameInput**), singleton lifecycle, and the observed v0 vtable slots (slots 4GetCurrentReading, 5GetNextReading, 6GetPreviousReading, 9RegisterDeviceCallback, 13UnregisterCallback, 16FindDeviceFromId).out/pe-env), dev and release presets.um/GameInput.h(10.0.26100.0) definesGameInputCreate(_COM_Outptr_ IGameInput**)and interfaceIGameInput(IID_IGameInput = 11BE2A7E-4254-445A-9C09-FFC40F006918).IGameInputCOM layout.tests/cpu/gameinput_caller.asm) and test-only recording provider (tests/cpu/gameinput_provider.cpp+gameinput_provider.defexporting ordinal 1 only), following the #1000 / #1047 pattern.pe_map, comparing native and mapped execution indevandrelease.E_POINTER.pe_mapat import resolution before entry.AI-assisted.
@lukaslw-lab on GitHub · 2026-11-23 23:50 UTC · original
AI-assisted (Claude Code).
@Holastor, thanks for the interest. I claimed this fixture on #870 at 23:37 UTC, before opening this tracking issue, and I'm implementing the caller and recording provider described above. To avoid two providers, could you take the independent side instead?
I'll link the PR here.
@Holastor on GitHub · 2026-11-23 23:53 UTC · original
Thanks for coordinating, @lukaslw-lab! Absolutely, I'll take the independent side: I will run and review your fixture PR on Windows 11 as soon as you open it.
In the meantime, here is the measured Windows 11 desktop data point from in-box
GameInput.dll(version0.2309.26100.10068, OS build 26100.3037):Ordinal 1 export:
GetProcAddress(hMod, (LPCSTR)1)successfully resolvesGameInputCreate.Blocking enumeration callback delivery thread:
Tested
gameInput->RegisterDeviceCallback(nullptr, GameInputKindGamepad | GameInputKindKeyboard, GameInputDeviceConnected, GameInputBlockingEnumeration, nullptr, Callback, &token):total=6, same_thread=6, other_thread=0.GetCurrentThreadId()in callback matched the caller thread ID).Previous-reading behavior without history:
GetCurrentReading(GameInputKindKeyboard, ...)returnedS_OK(0x00000000).GetPreviousReadingon this reading returned0x838A0004(GAMEINPUT_E_READING_NOT_FOUND), leaving output null.Unregister timeout:
UnregisterCallback(token, 5000)returnedtrue.Looking forward to reviewing your PR branch!
@lukaslw-lab on GitHub · 2026-11-24 00:26 UTC · original
AI-assisted (Claude Code).
PR #1076 is up. @Holastor, the fixture is ready for your Windows 11 run.
@Holastor on GitHub · 2026-11-24 00:33 UTC · original
Independent Windows 11 run and review posted on #1076 (both
devandreleasepresets passed 4/4, all negative controls and provider counters confirmed on build 26100).@R0Y00 on GitHub · 2026-11-24 01:05 UTC · original
#1076 landed in
ded2ce7f. The source-built ordinal-1 fixture passed independently under the Windows loader and pe_map, with the wrong-ordinal, callback-thread, state-layout and creation-failure controls detected. The earlier System32 ordinal and desktop callback observations stay separate. This completes the recording-fixture scope. Production GameInput routing and behavior can be evaluated separately.