Skip to content

gameinput: the retail executable imports GameInputCreate as GameInput.dll #1 and was built against v0 (settles a VERIFY, from the file) - #7667

Open
etcetera-yt wants to merge 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:gameinput-exe-module-version
Open

etcetera-yt wants to merge 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:gameinput-exe-module-version

Conversation

@etcetera-yt

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: new RT-5 item, #7599 (comment)

Depends on: none. Related: #3410 and #7216 register the ordinal-1 import this records; this PR doesn't touch the registry, so either order merges cleanly (no shared hunks).

What and why

docs/gameinput.md said "The game executable is not available yet, so whether it imports GameInput this way, and under which module, is unverified", and its VERIFY list asked which API version and module. runtime/shims/gameinput.cpp:32 had the matching ASSUMPTION, and tools/exe_checklist.py lists it as one of the things to confirm against the executable. This settles both from the executable file alone. Nothing was run; the file was read in place. Only names, counts and public IIDs are given here, no bytes of the image.

  • Module: the only GameInput import is GameInput.dll #1 (tools/pe_inspect.py). There's no xgameruntime.dll!GameInputCreate.
  • #1 is GameInputCreate: in the two import libraries that link GameInput this way, the Windows SDK's um/x64/GameInput.lib (10.0.26100, v0) and NuGet Microsoft.GameInput 1.2.26100.4782 (v1), the import object for GameInputCreate has name type ordinal, ordinal 1, DLL GameInput.dll.
  • Not v2–v4: NuGet 2.2.26100.6114, 3.5.283 and 4.1.314 ship a static GameInput.lib that loads GameInputRedist.dll and calls GameInputCreateWithVersion. The image contains neither name, in ASCII or UTF-16.
  • v0, not v1 (strong evidence): v1's GameInputCreate returns an IUnknown, and the header's inline wrapper calls QueryInterface(IID_IGameInput) with 40FFB7E4-6150-407A-B439-132BADC08D2D. That IID isn't in the image. Neither are any of the 30 interface IIDs in the v0–v4 headers, searched as their 16-byte in-memory form. v0 hands out IGameInput directly, which fits. It's not a proof, since a compiler can build a GUID on the stack, and the doc says so.

Changes: a new "The retail executable (RT-5)" section in docs/gameinput.md, the VERIFY bullet narrowed to what still needs a run (that the first calls land in v0's vtable slots), and the gameinput.cpp:32 comment rewritten to the measured facts (the by-name registrations don't serve the #1 import yet). There's no code change.

What's left: binding ordinal 1 (#3410 / #7216), and the run-time check of the vtable slots.

Tested

Windows 10 19045, RTX 5060 Ti (no GPU needed), main 34969aa20.

  • tools/pe_inspect.py on the image: GameInput.dll | normal | system | 1.
  • Import objects read from the five GameInput.lib files (a short local script), plus a 16-byte search of the image for each IID and DLL name (another local script). Neither is committed; I can post them if wanted.
  • tools/exe_checklist.py: the gameinput.cpp note is no longer listed.
  • tests/test_docs_*.py: all pass except test_docs_links (1) and test_docs_cli_flags (2). Both fail identically on main (docs/dev-tools.md, docs/embedded_shaders.md; not this PR).

Not tested: a run of the title (nothing was run), GameInput NuGet versions other than the four named above, and the console GDK's own GameInput.lib (not public).

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD

….dll ordinal 1 and was built against v0

Settles docs/gameinput.md's VERIFY "Which API version and module" and the ASSUMPTION at gameinput.cpp:32 from the
executable file alone (nothing run): its only GameInput import is GameInput.dll ItsNotRexed#1, which is GameInputCreate in the
SDK's (v0) and NuGet 1.2's (v1) import libraries; NuGet 2.x-4.x load GameInputRedist.dll / GameInputCreateWithVersion
at run time, and the image holds neither name; and v1's wrapper needs IID_IGameInput 40FFB7E4-..., which the image
doesn't hold (nor any of v0-v4's 30 interface IIDs). Docs and a comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD
@eizispark

Copy link
Copy Markdown

Tested 8bdc864 merged onto main (1befe1d) on AMD Radeon RX 9070 XT, Adrenalin 26.11.1 (LLPC / Vulkan 1.4.359), Windows 11:

  • ctest (16/16 passed): gameinput, gameinput_host, loader, pe_loader, pe_loader_bounds, loader_tls, run_tiny_game, run_tiny_game_console_paths, run_tiny_game_exit_code, run_tiny_game_abort_exit_codes, run_tiny_game_fixed, run_tiny_game_fixed_exit_code, run_tiny_game_tls, run_tiny_game_eh, run_tiny_game_stack, run_tiny_game_dir
  • tests/test_exe_checklist.py: 14/14 passed
  • gta6rt --dry-run (retail package executable): exit code 0

@guinpereira

Copy link
Copy Markdown

Code read and partial check of 8bdc86423, merged onto main 3ca3c4725 (clean merge), Windows 11 Pro (build 26200), Python 3.14.4. I have no executable, so the claims measured on the image are not checked here. This covers what can be checked without it.

  • SDK import library, confirmed. dumpbin /headers on the Windows SDK 10.0.26100.0 um\x64\gameinput.lib gives one import object: DLL name GameInput.dll, symbol GameInputCreate, name type ordinal, ordinal 1. This matches the PR's v0 claim. (The NuGet 1.x–4.x libraries were not checked.)
  • Hash. The cited SHA-256 e95020b2…08993 is the same one docs/runtime_imports.md:129-130 already records for game_scarlett_master.exe.
  • Docs tests (pytest tests/test_docs_*.py): 35 passed, 3 failed, the same on main and with the PR, in test_docs_cli_flags and test_docs_links (as the PR body says). None of the failures mention gameinput. The new #the-retail-executable-rt-5 anchor resolves to the new heading.
  • tools/exe_checklist.py: the gameinput.cpp:32 ASSUMPTION is gone. The other gameinput.cpp VERIFY entries stay, moved down 2 lines.
  • scripts/check_no_game_data.py docs/gameinput.md runtime/shims/gameinput.cpp: exit 0.
  • Diff: docs and one comment only, no code change. The new comment says plainly that the by-name registrations don't serve the ordinal import yet, which matches the loader note in the doc and leaves that work to gameinput: answer GameInputCreate imported by ordinal 1 #3410 / gameinput: serve GameInput.dll's ordinal 1, the retail executable's GameInputCreate import #7216.

AI-assisted (Claude Code). No game files.

@sgonzalez-glitch

Copy link
Copy Markdown

Tested 8bdc86423 (as part of #7619, #7634, #7653, #7667, #7704 and #7723 merged together onto main a90a79bd8) on NVIDIA GeForce RTX 2080, driver 621.24 (32.0.16.2124), Windows 11, MSVC 19.44 RelWithDebInfo: pass.

AI-assisted: yes

@etcetera-yt

Copy link
Copy Markdown
Contributor Author

Thanks @eizispark (RX 9070 XT, including the retail --dry-run), @guinpereira (the dumpbin check of the SDK's import object and the hash) and @sgonzalez-glitch (RTX 2080, full ctest) for the checks. AI-assisted (Claude Code).

@optinium51-bot

Copy link
Copy Markdown

Tested 8bdc86423 merged onto main 867d922f0 (clean merge) on NVIDIA GeForce RTX 3060 (driver 616.92), Windows 11 26200, MSVC 14.52 (VS 2026), RelWithDebInfo + Ninja, with the GameInput shim built (-DLEONIDA_SDL3_FETCH=ON, SDL3 3.4.20): pass.

No game files. AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants