XStore: wire offline *Result slots and fix OOB XStoreShowProductPageUIResult slot #475

Manually merged
github merged 1 commit from gh-pr/475/head into gh-pr/475/base 2026-11-26 04:05:19 +00:00
Owner

@⁠nathanbzrr on GitHub · 2026-11-24 03:50 UTC · original
nathanbzrr:fix/xstore-missing-result-slots → main · +133 −5 · 1 files · 1 commits · merged 2026-11-25 00:11 UTC

Problem

Several offline XStore*Async vtable slots (0x118, 0x188, 0x1a8, 0x258) complete their XAsyncBlock with NETWORK_ERROR, while their paired *Result slots in crates/victory-hle/src/modules/xstore.rs were:

  • Missing past the end of VTABLE (Methods<76>, slots 0..=75): calling XStoreShowProductPageUIResult at slot 76 (0x260) reads past VTABLE.
  • Left as missing::<N> returning E_NOTIMPL instead of NETWORK_ERROR (0x120 XStoreReportConsumableFulfillmentResult, 0x190 XStoreShowPurchaseUIResult, 0x1b0 XStoreShowRedeemTokenUIResult).
  • Using status (2 args) at slot 34 (0x110, XStoreQueryConsumableBalanceRemainingResult) instead of 3-arg count_status taking (This, *mut AsyncBlock, *mut u32).

What changed

  • Extended xstore::VTABLE in crates/victory-hle/src/modules/xstore.rs from Methods<76> to Methods<77>.
  • Wired slot 34 (0x110, XStoreQueryConsumableBalanceRemainingResult) and slot 36 (0x120, XStoreReportConsumableFulfillmentResult) to count_status.
  • Wired slot 50 (0x190, XStoreShowPurchaseUIResult), slot 54 (0x1b0, XStoreShowRedeemTokenUIResult), and slot 76 (0x260, XStoreShowProductPageUIResult) to status.
  • Added synthetic unit test offline_async_calls_report_network_error_from_their_result_slots verifying VTABLE bounds and 0x258/0x260, 0x118/0x120, 0x188/0x190, 0x1a8/0x1b0, and 0x108/0x110.

Tests (isolated branch 2c22e2b)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xstore.rs: passed (exit 0).
  • cargo test -p victory-hle --lib xstore: 2 passed, 0 failed, 85 filtered out (modules::xstore::tests::offline_async_calls_report_network_error_from_their_result_slots, modules::xstore::tests::the_game_is_licensed_and_the_store_is_offline).
  • cargo clippy -p victory-hle --all-targets: passed (exit 0; 0 errors/warnings in crates/victory-hle/src/modules/xstore.rs).
  • cargo xtask policy: asset policy: 151 files ok.

No game files. AI-assisted; reviewed and verified with the tests above.

**@⁠nathanbzrr** on GitHub · 2026-11-24 03:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/475) `nathanbzrr:fix/xstore-missing-result-slots` → `main` · +133 −5 · 1 files · 1 commits · merged 2026-11-25 00:11 UTC ## Problem Several offline `XStore*Async` vtable slots (`0x118`, `0x188`, `0x1a8`, `0x258`) complete their `XAsyncBlock` with `NETWORK_ERROR`, while their paired `*Result` slots in `crates/victory-hle/src/modules/xstore.rs` were: - Missing past the end of `VTABLE` (`Methods<76>`, slots `0..=75`): calling `XStoreShowProductPageUIResult` at slot 76 (`0x260`) reads past `VTABLE`. - Left as `missing::<N>` returning `E_NOTIMPL` instead of `NETWORK_ERROR` (`0x120` `XStoreReportConsumableFulfillmentResult`, `0x190` `XStoreShowPurchaseUIResult`, `0x1b0` `XStoreShowRedeemTokenUIResult`). - Using `status` (2 args) at slot 34 (`0x110`, `XStoreQueryConsumableBalanceRemainingResult`) instead of 3-arg `count_status` taking `(This, *mut AsyncBlock, *mut u32)`. ## What changed - Extended `xstore::VTABLE` in `crates/victory-hle/src/modules/xstore.rs` from `Methods<76>` to `Methods<77>`. - Wired slot 34 (`0x110`, `XStoreQueryConsumableBalanceRemainingResult`) and slot 36 (`0x120`, `XStoreReportConsumableFulfillmentResult`) to `count_status`. - Wired slot 50 (`0x190`, `XStoreShowPurchaseUIResult`), slot 54 (`0x1b0`, `XStoreShowRedeemTokenUIResult`), and slot 76 (`0x260`, `XStoreShowProductPageUIResult`) to `status`. - Added synthetic unit test `offline_async_calls_report_network_error_from_their_result_slots` verifying `VTABLE` bounds and `0x258`/`0x260`, `0x118`/`0x120`, `0x188`/`0x190`, `0x1a8`/`0x1b0`, and `0x108`/`0x110`. ## Tests (isolated branch `2c22e2b`) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xstore.rs`: passed (exit 0). - `cargo test -p victory-hle --lib xstore`: 2 passed, 0 failed, 85 filtered out (`modules::xstore::tests::offline_async_calls_report_network_error_from_their_result_slots`, `modules::xstore::tests::the_game_is_licensed_and_the_store_is_offline`). - `cargo clippy -p victory-hle --all-targets`: passed (exit 0; 0 errors/warnings in `crates/victory-hle/src/modules/xstore.rs`). - `cargo xtask policy`: `asset policy: 151 files ok`. No game files. AI-assisted; reviewed and verified with the tests above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:05:17 +00:00
github manually merged commit 2c22e2b2d2 into gh-pr/475/base 2026-11-26 04:05:19 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!475
No description provided.