GameInput: answer IUnknown and own-IID queries on the COM objects (re-lands #1641) #1942
No reviewers
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!1942
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1942"
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?
@Calvix2k on GitHub · 2026-11-25 01:25 UTC · original
Calvix2k:codex/gameinput-query-interface-020→main· +157 −18 · 1 files · 3 commits · openRe-lands #1641 (closed by the automated triage as an asset-policy violation, which I believe is a false positive: the three IIDs are constants from the public Windows SDK GameInput.h, not console SDK code or game assets; the change touches only crates/victory-hle/src/modules/gameinput.rs, and cargo xtask policy passes on the rebased tree. If the IID constants are what tripped it, please say so and I will put them behind a generator from the installed SDK header instead.)
What
IGameInput, IGameInputDevice and IGameInputReading shared one
o_interface slot. Each now has its own QueryInterface that accepts IID_IUnknown and its own interface id (GameInput.h), AddRefs through slot 1, and returns E_NOINTERFACE/E_POINTER otherwise.
BaggyALPHA's follow-up from the v0 table review is included: the Windows SDK device interface has 22 slots, and the table stopped at 21.
The regression test queries the device IID first, then calls the three slots with the SDK signatures on a synthetic device.
Verification (Windows 10, Ryzen 7 5800X / RX 7800 XT)
4118f33(no conflicts).@Marvisak on GitHub · 2026-11-25 08:19 UTC · original · edited 2026-11-26 00:22 UTC
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. The head (
32db7d9) hasn't changed, so the code verdict stands.query_interfaceincrates/victory-hle/src/modules/gameinput.rsreads correctly, and the 22-slot device table with its typed stubs at 0x38, 0xa0 and 0xa8 is fine. I checked the diff again and it names no SDK headers, paths or kits.On the replies (yours and BaggyALPHA's): agreed that the open question is the policy call, not the code. The three interface ids are the same kind of constant
mainalready keeps (IID_2026inmodules/storage.rs, the ids inmodules/display.rsandmodules/media.rs), anddocs/asset-policy.mdallows small interoperability constants. But #1641 was closed over exactly this question, so reversing that decision is for the maintainer, not triage. If it is accepted, this PR supersedes #1329, which BaggyALPHA has offered to close. Nothing more is needed from you in the meantime.CI: passing (
check).Generated by Claude Code
@Calvix2k on GitHub · 2026-11-25 10:23 UTC · original
Thanks — the wording half is done, and I agree the rest is the maintainer's call. One note to make that call easier, since the triage lists three PRs for the same slot:
IID_IUnknownonly, without the interface ids.IID_IUnknownplus each object's own id, keeps the reading's reference counting through its own slot 1, and carries the 22-slot device table with the typed stubs at 0x38, 0xa0 and 0xa8. It is a superset of #1329; if it lands, #1329 is redundant.On the asset policy: the three ids are the same kind of interoperability constants
mainalready keeps inmedia.rsanddisplay.rs; they are the values a title passes toQueryInterface, and the test uses them as such. If the maintainer reads that as acceptable, landing this one and closing #1329 leaves a single GameInput slot-0 implementation.The commit message from
883440dmentioning "the SDK's 22-slot device table" only lives in history and disappears on a squash, as the triage notes.@BaggyALPHA on GitHub · 2026-11-25 15:18 UTC · original
On the asset-policy question this inherited from #1641: the constants are public PC API surface, and
mainalready carries the same two kinds. Evidence below; the call is still the maintainer's.I have an interest to declare: my #1329 is the narrow alternative to this PR, so if this one is acceptable mine is redundant and I will close it. That cuts against me, which is why I would rather the question were settled on facts than left to sit.
What actually closed #1641. The closure was automated triage, with the generic line "nothing taken from the console SDK or the game", and it invites correction: "If this is mistaken, reply here with what was missed". No human review found a specific violation, and @Calvix2k already called it a likely false positive.
1. GameInput is a public PC API, not console SDK material. Microsoft documents
IGameInput,IGameInputDeviceandIGameInputReadingpublicly, and shipsGameInput.hfor PC via NuGet from a public repository, supporting Windows 10 19H1 and later — distribution that is separate from Xbox GDK licensing ("GameInput is available on Xbox via the GDK and PC via NuGet"). So these IIDs are the same class of constant as any other public Windows interface id. Sources: IGameInputDevice reference, GameInput API members, public GameInput distribution.2.
mainalready carries both kinds of constant this PR adds. At940d32f:Guid::newconstants (rpcrt46,xgame5,display5,xsystem4,xstore/storage3 each, and so on).modules/xpackage.rsdefinesIID_2026under the comment "As Grand Theft Auto VI (2026) asks for it. Its slots up to0xd0take the arguments the public API lists in the same order;0x110uninstalls a package,0x128/0x130mount one with UI,0x138enumerates packages." That is the same shape as this PR's0x38/0xa0/0xa8, and it is onmaintoday.modules/gameinput.rsalready declaresTable<22>,Table<21>andTable<25>. The 22-slot correction here changes the device table from 21 to 22 — a correction to a number already in the file, not a new kind of information.3. Against the policy's own wording. docs/asset-policy.md forbids the title's assets and executable and anything derived from them, and explicitly allows "small interoperability constants (magic numbers, enum values) we write" and "per-build offsets of functions we hook, under names we choose". Nothing here comes from the title's executable.
4. Provenance of the 22-slot correction, since it is mine. I derived it from the signatures in the public header and verified it against a synthetic device in a Windows test, not from the title's binary — eight GameInput tests passed at the time. If anything in this PR were going to be game-derived it would be that piece, and it is not.
So on the evidence the stated ground for closing #1641 does not appear to apply here, and this PR's constants match accepted practice in the tree. Whether that is the right call is still the maintainer's, and I am not asking for a verdict in this thread — only that the question not be the thing that keeps VIC-BT-020 unfixed.
No game files were used for any of the above: it is the public documentation, the policy text, and
grepovermain.AI-assisted (Claude Code).
@Calvix2k on GitHub · 2026-11-25 16:39 UTC · original
Agree with the analysis, and it matches what I said when #1641 was closed: the closure there was a false positive on the policy. The constants are public PC API (
GameInput.hvia NuGet),mainalready carries interface ids and slot offsets of the same shape (xpackage'sIID_2026), and the 22-slot table size is a correction to a number already in the file. Nothing here is game-derived.So the only open question is the merge decision, not the policy. If this lands, #1329 can close; I will leave that call to @Marvisak.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.