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

Open
opened 2026-11-26 04:14:08 +00:00 by github-bot · 2 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 13:48 UTC · original

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.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 13:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/901) ### 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.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:08 +00:00
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 13:57 UTC · original

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.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 13:57 UTC · [original](https://github.com/Marvisak/VIctory/issues/901#issuecomment-7133586763) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:53 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/901#issuecomment-7155268122) <!-- 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)_
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#901
No description provided.