[PR #537] RT-XAPPCAPTURE: serve XAppCaptureImpl in the xgameruntime shim - the exe's last unserved thunk #584

Open
opened 2026-11-26 20:18:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/537
Author: @tengotengo
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: rt-xappcapture


📝 Commits (2)

  • e7dc1e2 xgameruntime: serve XAppCaptureImpl (RT-XAPPCAPTURE) - the exe's last unserved thunk
  • 2581f6d docs: rewrite the served-classes note for post-#401 main (XAppCapture offline E_NOTIMPL availability)

📊 Changes

4 files changed (+72 additions, -15 deletions)

View changed files

📝 docs/runtime_imports.md (+11 -7)
📝 runtime/shims/xgameruntime.cpp (+41 -4)
📝 runtime/test/xgameruntime_test.cpp (+19 -3)
📝 tests/test_gdk_runtime_calls.py (+1 -1)

📄 Description

Claimed in the coordination issue as: RT-XAPPCAPTURE (#14)

What and why

The retail executable's one xgameruntime reference this file used to refuse: it queries the class
a4f1aee2-4bf1-4485-b008-a7c26d52ac27 for IXAppCaptureImpl4 and calls slot 5,
XAppCaptureTakeScreenshot (measured in game_scarlett_master.exe; one thunk). QueryApiImpl
answered kClassNotProvided for it, so the call died on a null pointer path and
XGameRuntimeIsFeatureAvailable(XAppCapture) reported false.

This pull request serves the class from runtime/shims/xgameruntime.cpp:

  • The full IXAppCaptureImpl .. 4 layout from tools/gdk_runtime_classes.json (18 slots:
    IUnknown + Impl's 8 + Impl2's 4 + Impl3's 2 + Impl4's 1). The class id is also
    IXAppCaptureImpl's id, and the object answers the class id and the v2/v3/v4 interface ids
    (the executable requests with the v4 interface id).
  • There is no console capture or record offline, so every method is E_NOTIMPL (the
    net_not_implemented pattern): a title that checks the HRESULT sees unsupported, and
    XAppCapture in the feature table becomes available, which matches Microsoft documenting it
    for Windows.
  • kAppCaptureClassId renamed to kAppCaptureClass, so tools/gdk_runtime_calls.py counts the
    class as served.

With it, every thunk the executable references is served: the tool's report on the exe goes
from not-served-referenced: XAppCaptureImpl (slot 5) to not-served=- not-served-referenced=-
(161 thunks, 158 referenced, 17 classes).

Tested

Windows cross-build (clang-cl 23.1.4 + xwin SDK 10.0.26100 splat) on a Linux box with an RTX 5060 Ti:

  • runtime/test/xgameruntime_test under Wine 11.21: 161 checks, all pass - three new: the object
    answers the class id and the v4 interface id, slot 5 refuses with E_NOTIMPL, a bogus interface
    id is E_NOINTERFACE; the feature-availability consistency check now covers XAppCapture=true.
  • Full ctest under Wine: 23 failures before and after this change, byte-identical failure set
    (276/299 pass both ways) - the 23 are the documented headless-Wine environment failures
    (presentation without a display, host-D3D12 comparisons, GameInput/SDL3), not regressions.
  • python3 -I tests/test_gdk_runtime_calls.py: 23 tests OK (the served-class assertion updated
    from notIn to kAppCaptureClass).
  • tools/gdk_runtime_calls.py re-run on the exe: XAppCaptureImpl now "served by the runtime";
    zero unserved classes.
  • scripts/check_no_game_data.py on the changed files: clean.
  • No game files were needed beyond the measured ids and slot; nothing was run against the
    retail package.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (not applicable: no translator change)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/537 **Author:** [@tengotengo](https://github.com/tengotengo) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `rt-xappcapture` --- ### 📝 Commits (2) - [`e7dc1e2`](https://github.com/ubiquitarianism/leonida/commit/e7dc1e2b613b83bb99fb7cb6be00563a0333da01) xgameruntime: serve XAppCaptureImpl (RT-XAPPCAPTURE) - the exe's last unserved thunk - [`2581f6d`](https://github.com/ubiquitarianism/leonida/commit/2581f6da81f69d6397c8349aee787863dacb45ea) docs: rewrite the served-classes note for post-#401 main (XAppCapture offline E_NOTIMPL availability) ### 📊 Changes **4 files changed** (+72 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `docs/runtime_imports.md` (+11 -7) 📝 `runtime/shims/xgameruntime.cpp` (+41 -4) 📝 `runtime/test/xgameruntime_test.cpp` (+19 -3) 📝 `tests/test_gdk_runtime_calls.py` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: RT-XAPPCAPTURE (#14) ### What and why The retail executable's one xgameruntime reference this file used to refuse: it queries the class `a4f1aee2-4bf1-4485-b008-a7c26d52ac27` for `IXAppCaptureImpl4` and calls slot 5, `XAppCaptureTakeScreenshot` (measured in `game_scarlett_master.exe`; one thunk). `QueryApiImpl` answered `kClassNotProvided` for it, so the call died on a null pointer path and `XGameRuntimeIsFeatureAvailable(XAppCapture)` reported false. This pull request serves the class from `runtime/shims/xgameruntime.cpp`: - The full `IXAppCaptureImpl .. 4` layout from `tools/gdk_runtime_classes.json` (18 slots: IUnknown + Impl's 8 + Impl2's 4 + Impl3's 2 + Impl4's 1). The class id is also `IXAppCaptureImpl`'s id, and the object answers the class id and the v2/v3/v4 interface ids (the executable requests with the v4 interface id). - There is no console capture or record offline, so every method is `E_NOTIMPL` (the `net_not_implemented` pattern): a title that checks the HRESULT sees unsupported, and `XAppCapture` in the feature table becomes available, which matches Microsoft documenting it for Windows. - `kAppCaptureClassId` renamed to `kAppCaptureClass`, so `tools/gdk_runtime_calls.py` counts the class as served. With it, **every thunk the executable references is served**: the tool's report on the exe goes from `not-served-referenced: XAppCaptureImpl (slot 5)` to `not-served=- not-served-referenced=-` (161 thunks, 158 referenced, 17 classes). ### Tested Windows cross-build (clang-cl 23.1.4 + xwin SDK 10.0.26100 splat) on a Linux box with an RTX 5060 Ti: - `runtime/test/xgameruntime_test` under Wine 11.21: 161 checks, all pass - three new: the object answers the class id and the v4 interface id, slot 5 refuses with `E_NOTIMPL`, a bogus interface id is `E_NOINTERFACE`; the feature-availability consistency check now covers XAppCapture=true. - Full `ctest` under Wine: 23 failures before and after this change, byte-identical failure set (276/299 pass both ways) - the 23 are the documented headless-Wine environment failures (presentation without a display, host-D3D12 comparisons, GameInput/SDL3), not regressions. - `python3 -I tests/test_gdk_runtime_calls.py`: 23 tests OK (the served-class assertion updated from notIn to `kAppCaptureClass`). - `tools/gdk_runtime_calls.py` re-run on the exe: XAppCaptureImpl now "served by the runtime"; zero unserved classes. - `scripts/check_no_game_data.py` on the changed files: clean. - No game files were needed beyond the measured ids and slot; nothing was run against the retail package. AI-assisted: yes (Claude Code) ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (not applicable: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#584
No description provided.