HLE: implement IUnknown::QueryInterface and unit tests for xgame objects #901

Open
opened 2026-11-24 13:48:14 +00:00 by geiyiliyabumo · 2 comments
geiyiliyabumo commented 2026-11-24 13:48:14 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T13:48:14Z.


Summary

Implements IUnknown::QueryInterface across all four static xgame COM objects (TITLE_OBJECT, FEATURES_OBJECT, INVITES_OBJECT, EVENTS_OBJECT, replacing all 4 missing::<0> slots) and adds comprehensive synthetic unit tests in crates/victory-hle/src/modules/xgame.rs.

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@feat/xgame-missing-slots
  • Commit: geiyiliyabumo/VIctory@299bc17 (based on main ffe310e)

Changes (crates/victory-hle/src/modules/xgame.rs)

  • Implemented query_interface: validates out and iid (E_POINTER, always zeroing *out before returning on error), answers IID_IUNKNOWN and each object's own IID with this + S_OK, and returns E_NOINTERFACE for unknown IIDs or mismatched objects.
  • Wired query_interface at slot 0 in TITLE_VTABLE, FEATURES_VTABLE, INVITES_VTABLE, and EVENTS_VTABLE.
  • Expanded unit test coverage from 2 to 15 passing tests covering QueryInterface (all 4 objects, IUnknown, own IID, wrong IID, null out/iid) and existing xgame methods.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xgame.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- xgame: 15 passed, 0 failed

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6583248423 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/901). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T13:48:14Z. --- ### Summary Implements `IUnknown::QueryInterface` across all four static `xgame` COM objects (`TITLE_OBJECT`, `FEATURES_OBJECT`, `INVITES_OBJECT`, `EVENTS_OBJECT`, replacing all 4 `missing::<0>` slots) and adds comprehensive synthetic unit tests in `crates/victory-hle/src/modules/xgame.rs`. Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@feat/xgame-missing-slots` - **Commit**: `geiyiliyabumo/VIctory@299bc17` (based on `main` `ffe310e`) ### Changes (`crates/victory-hle/src/modules/xgame.rs`) - Implemented `query_interface`: validates `out` and `iid` (`E_POINTER`, always zeroing `*out` before returning on error), answers `IID_IUNKNOWN` and each object's own IID with `this` + `S_OK`, and returns `E_NOINTERFACE` for unknown IIDs or mismatched objects. - Wired `query_interface` at slot `0` in `TITLE_VTABLE`, `FEATURES_VTABLE`, `INVITES_VTABLE`, and `EVENTS_VTABLE`. - Expanded unit test coverage from 2 to **15 passing tests** covering `QueryInterface` (all 4 objects, `IUnknown`, own IID, wrong IID, null `out`/`iid`) and existing `xgame` methods. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xgame.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- xgame`: **15 passed, 0 failed** *AI-assisted; synthetic tests only, no game files.*
MichaelSmithAI commented 2026-11-24 14:04:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T13:57:03Z.


Independent Win64/Wine check on 299bc17 with one additional fixture. It obtained title, features, invites and events through the runtime’s QueryApiImpl entry point. Each returned a distinct IUnknown pointer. Querying each IUnknown for its own interface returned the original pointer, and the fixture released all three references acquired per object.

All 16 tests selected by the xgame filter passed, including the new runtime lookup check. This verifies identity through the guest entry point. The objects use the existing static lifetime and fixed Release return value, so the test does not measure object destruction.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7133586763 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/901#issuecomment-7133586763). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T13:57:03Z. --- Independent Win64/Wine check on 299bc17 with one additional fixture. It obtained title, features, invites and events through the runtime’s QueryApiImpl entry point. Each returned a distinct IUnknown pointer. Querying each IUnknown for its own interface returned the original pointer, and the fixture released all three references acquired per object. All 16 tests selected by the `xgame` filter passed, including the new runtime lookup check. This verifies identity through the guest entry point. The objects use the existing static lifetime and fixed Release return value, so the test does not measure object destruction.
Marvisak commented 2026-11-25 07:03:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:53:37Z.


Automated triage for the maintainers.

On main slot 0 (QueryInterface) of the four static objects in crates/victory-hle/src/modules/xgame.rs is still missing::<0>, so this fits the project. The change is already open as pull request #1174 by the same author (branch feat/xgame-missing-slots), which is where review belongs. The decision is left to the maintainers there.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155268122 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/901#issuecomment-7155268122). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:53:37Z. --- <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T13:57:03Z at=2026-11-25T06:53:36Z --> Automated triage for the maintainers. On `main` slot 0 (`QueryInterface`) of the four static objects in `crates/victory-hle/src/modules/xgame.rs` is still `missing::<0>`, so this fits the project. The change is already open as pull request #1174 by the same author (branch `feat/xgame-missing-slots`), which is where review belongs. The decision is left to the maintainers there. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#901
No description provided.