xcrdapi: accept the newer IDStorageQueueX IID and CreateQueue at factory slot 10 #337

Closed
github-bot wants to merge 1 commit from gh-pr/337/head into gh-pr/337/base
Owner

@⁠GDAgent on GitHub · 2026-11-23 20:30 UTC · original
GDAgent:fix/xcrdapi-queue-x1-slot10 → main · +60 −11 · 3 files · 1 commits · closed without merging

Library / area: xcrdapi (abi.rs, objects.rs, tests.rs)

Exports changed (exports.txt rows): none

Source of the behaviour: call sites of a very popular AAA title (Xbox Series X build), native Windows 11 on an RDNA2 GPU; not run under Proton.

What

  • IID_QUEUE_X1 (3c02cb0c-c050-4195-99a1-a1ce94ba33c5) is answered by the queue object's QueryInterface with the same object, next to IID_QUEUE_X and IUnknown.
  • IDStorageFactoryX slot 10 was a trap. It now creates a queue: the title passes a 0x20-byte desc, which is the 0x18-byte desc that slot 3 (CreateQueue) already takes plus 8 bytes at +0x18. Slots 3 and 10 share one implementation (create_queue_from); the extra 8 bytes are read, logged as "not modelled" and otherwise ignored.

Why / evidence

Static evidence from the title's code (no run reached slot 10 yet):

  • Its factory calls go to slots 4 (OpenFile), 5 (CreateStatusArray), 8 (SetStagingBufferSize, 32 MiB) and 10. The first three match the existing console-layout IDStorageFactoryX.
  • Slot 10 takes (desc, riid, ppv) like CreateQueue. The desc is 0x20 bytes: the existing 0x18-byte console queue desc (source type, capacity at 8, priority at 0xa, name at 0x10) plus a u64 at 0x18 that the title sets to 1.
  • The riid it passes to slot 10 is 3c02cb0c-c050-4195-99a1-a1ce94ba33c5. In .rdata it sits next to the factory IID and the known status-array IID, so it is taken to be the queue interface of the same SDK version.

Slots 9 and 11-15 stay traps, so any newer method the title calls stops the run with a named slot instead of running on a guessed ABI.

This is independent of #296, which accepts the newer factory IID (62959d11-...) in factory_qi. This PR does not touch factory_qi or add that IID, so the two do not conflict; the title needs both to reach slot 10 (with #296 it gets the factory; with this PR slot 10 then creates a queue).

Tests

  • newer_queue_iid_reaches_the_same_queue_and_factory_slot_10_creates_queues: slot 10 with a memory-queue desc (name pointer, capacity, realtime priority, 8 extra bytes) returns S_OK and a queue that answers IID_QUEUE_X, IID_QUEUE_X1 and IUnknown with the same pointer; QueryInfo echoes the first 0x18 desc bytes; an invalid memory-queue priority returns E_DSTORAGE_INVALID_MEMORY_QUEUE_PRIORITY with a null out pointer; a null desc returns E_INVALIDARG; a null out pointer returns E_POINTER; a file-queue desc works and releases cleanly.
  • cargo test -p xcrdapi: 164 passed, 1 failed. The failure is fixed_result_exports_match_every_console_xcrdapi, which needs console xcrdapi.dll dumps this machine does not have (it fails the same way on main). The new test passes.

Not verified

  • Not verified in a title run: the evidence is static, and no run has reached slot 10 yet, so no DStorage read through a slot-10 queue has been seen.
  • The 8 bytes at +0x18 and the behavioural difference between slot 3 and slot 10 queues are not known; this PR only makes slot 10 create the same queue slot 3 does.
  • The newer queue IID is only checked against the title's call site, not against a console oracle.
**@⁠GDAgent** on GitHub · 2026-11-23 20:30 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/337) `GDAgent:fix/xcrdapi-queue-x1-slot10` → `main` · +60 −11 · 3 files · 1 commits · closed without merging **Library / area:** `xcrdapi` (`abi.rs`, `objects.rs`, `tests.rs`) **Exports changed (exports.txt rows):** none **Source of the behaviour:** call sites of a very popular AAA title (Xbox Series X build), native Windows 11 on an RDNA2 GPU; not run under Proton. ## What - `IID_QUEUE_X1` (`3c02cb0c-c050-4195-99a1-a1ce94ba33c5`) is answered by the queue object's `QueryInterface` with the same object, next to `IID_QUEUE_X` and `IUnknown`. - `IDStorageFactoryX` slot 10 was a trap. It now creates a queue: the title passes a 0x20-byte desc, which is the 0x18-byte desc that slot 3 (`CreateQueue`) already takes plus 8 bytes at `+0x18`. Slots 3 and 10 share one implementation (`create_queue_from`); the extra 8 bytes are read, logged as "not modelled" and otherwise ignored. ## Why / evidence Static evidence from the title's code (no run reached slot 10 yet): - Its factory calls go to slots 4 (OpenFile), 5 (CreateStatusArray), 8 (SetStagingBufferSize, 32 MiB) and 10. The first three match the existing console-layout `IDStorageFactoryX`. - Slot 10 takes `(desc, riid, ppv)` like `CreateQueue`. The desc is 0x20 bytes: the existing 0x18-byte console queue desc (source type, capacity at 8, priority at 0xa, name at 0x10) plus a u64 at 0x18 that the title sets to 1. - The riid it passes to slot 10 is `3c02cb0c-c050-4195-99a1-a1ce94ba33c5`. In `.rdata` it sits next to the factory IID and the known status-array IID, so it is taken to be the queue interface of the same SDK version. Slots 9 and 11-15 stay traps, so any newer method the title calls stops the run with a named slot instead of running on a guessed ABI. This is independent of #296, which accepts the newer factory IID (`62959d11-...`) in `factory_qi`. This PR does not touch `factory_qi` or add that IID, so the two do not conflict; the title needs both to reach slot 10 (with #296 it gets the factory; with this PR slot 10 then creates a queue). ## Tests - `newer_queue_iid_reaches_the_same_queue_and_factory_slot_10_creates_queues`: slot 10 with a memory-queue desc (name pointer, capacity, realtime priority, 8 extra bytes) returns S_OK and a queue that answers `IID_QUEUE_X`, `IID_QUEUE_X1` and `IUnknown` with the same pointer; `QueryInfo` echoes the first 0x18 desc bytes; an invalid memory-queue priority returns `E_DSTORAGE_INVALID_MEMORY_QUEUE_PRIORITY` with a null out pointer; a null desc returns `E_INVALIDARG`; a null out pointer returns `E_POINTER`; a file-queue desc works and releases cleanly. - `cargo test -p xcrdapi`: 164 passed, 1 failed. The failure is `fixed_result_exports_match_every_console_xcrdapi`, which needs console `xcrdapi.dll` dumps this machine does not have (it fails the same way on `main`). The new test passes. ## Not verified - Not verified in a title run: the evidence is static, and no run has reached slot 10 yet, so no DStorage read through a slot-10 queue has been seen. - The 8 bytes at `+0x18` and the behavioural difference between slot 3 and slot 10 queues are not known; this PR only makes slot 10 create the same queue slot 3 does. - The newer queue IID is only checked against the title's call site, not against a console oracle.
A newer GXDK title that already gets its factory (IID 62959d11-...) calls
IDStorageFactoryX slot 10 next. Evidence from that title's code (static only,
a very popular AAA title):
- Slot 10 takes (desc, riid, ppv) like CreateQueue (slot 3). The desc is 0x20
  bytes: the existing 0x18-byte console queue desc (source type, capacity at 8,
  priority at 0xa, name at 0x10) plus a u64 at 0x18 that the title sets to 1.
- The riid it passes is 3c02cb0c-c050-4195-99a1-a1ce94ba33c5. In .rdata it sits
  next to the factory IID and the known status-array IID, so it is the queue
  interface of the same SDK version.

Changes:
- queue QI also answers IID_QUEUE_X1 with the same queue object;
- factory slot 10 is CreateQueue with the 0x20 desc. It shares the existing
  validation and creation path (create_queue_from); the extra u64 is logged as
  not modelled.
Slots 9 and 11-15 stay traps, so any newer method the title calls stops the run
with a named slot instead of running on a guessed ABI. Methods of the newer
queue interface beyond the existing queue layout are not known yet.

Test: newer_queue_iid_reaches_the_same_queue_and_factory_slot_10_creates_queues
(slot 10 creates memory and file queues; the queue answers X, X1 and IUnknown;
its info echoes the desc; memory queue priority, null desc and null out are
refused).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:19:24 +00:00
github-bot closed this pull request 2026-11-26 06:19:24 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:50 UTC · original

Applied on main in 5129361 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:50 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/337#issuecomment-7164360788) Applied on main in 5129361 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.