GameInput: answer IUnknown and own-IID queries on the COM objects (re-lands #1641) #1940
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T01:25:59Z.
Re-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).Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:10:42Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.
GameInput: answer IUnknown and own-IID queries: COM identity fix — pairs with #1641's earlier GameInput IUnknown work.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:19:06Z.
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
upstream-sync referenced this pull request2026-11-25 10:07:36 +00:00
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T10:23:20Z.
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.upstream-sync referenced this pull request2026-11-25 11:05:18 +00:00
Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-25T15:18:21Z.
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).
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T16:39:14Z.
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.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T02:40:42Z.
Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, worktree-local
CARGO_TARGET_DIR,CARGO_BUILD_JOBS=2, no game data).32db7d9; the local shallow clone has no merge-base againstorigin/main, so the diff/negative control were checked against the PR's actual parent4118f33.cargo test --locked -p victory-hle --lib -- modules::gameinput::tests::query_interface_answers_identity_and_the_objects_own_iid --exact --test-threads=1 --quiet->test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 143 filtered out(exit 0).git diff --check 4118f33 HEAD-> exit 0.4118f33(git grep -c ... crates/victory-hle/src/modules/gameinput.rs-> exit 1).Note: only the named synthetic QueryInterface test was replayed; the full crate suite was not run. The maintainer's
needs-worktriage about the inherited constant-policy discussion is outside this check. GPU/driver: N/A (CPU-only HLE test). AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.