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

Open
github-bot wants to merge 2 commits from github-bot/gh-537 into main AGit
Owner

@⁠tengotengo on GitHub · 2026-11-24 07:12 UTC · original
tengotengo:rt-xappcapture → main · +72 −15 · 4 files · 2 commits · open

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)
**@⁠tengotengo** on GitHub · 2026-11-24 07:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537) `tengotengo:rt-xappcapture` → `main` · +72 −15 · 4 files · 2 commits · open 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)
The retail executable queries the class a4f1aee2 (IXAppCaptureImpl .. 4,
from tools/gdk_runtime_classes.json) for IXAppCaptureImpl4 and calls slot
5, XAppCaptureTakeScreenshot - its one xgameruntime reference this file
used to refuse with kClassNotProvided. Serve the class with the full 18-
slot layout, every method E_NOTIMPL (no console capture or record
offline), the v2/v3/v4 interface ids answered alongside the class id, and
kAppCaptureClassId renamed to kAppCaptureClass so gdk_runtime_calls.py
counts the class as served. With it, every thunk the executable
references is served (161 thunks / 158 referenced / 17 classes, zero
unserved).

xgameruntime_test gains the positive checks (object, slot 5 refusal,
bogus interface id); test_gdk_runtime_calls.py's served-class assertion
and docs/runtime_imports.md's state notes follow.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:07:15 +00:00
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 07:54 UTC · original

Review of head df1800d47f37eb6178fa658bf2afa79830ca00a9 (read-only; Linux, Python 3, no Windows/MSVC).

What ran:

  • python3 -I tests/test_gdk_runtime_calls.py: 23 tests, OK (including the updated kAppCaptureClass served assertion).
  • Not built: xgameruntime.cpp and xgameruntime_test.cpp include <windows.h>, so they cannot be built here.

Checked against the repository:

  • Class id a4f1aee2-... and the IIDs for Impl2 3a949778-..., Impl3 2bbca60a-... and Impl4 22e672d7-... match tools/gdk_runtime_classes.json. The class id is also IXAppCaptureImpl's IID there, and object_query_interface accepts *class_id, so v1 is served without being in kAppCaptureIids.
  • Vtable order 3-17 matches the method lists in that json (8 + 4 + 2 + 1 = 15, plus IUnknown = 18, as the static_assert says). Slot 5 is XAppCaptureTakeScreenshot, as docs/runtime_imports.md records for the executable.
  • Offline safety (reasoning): every slot returns E_NOTIMPL and writes nothing. On x64 a one-argument stub is safe for callers that pass more arguments. A caller that checks the HRESULT skips the call, and the out structs are left untouched, which is no worse than the previous null object.

Points to consider:

  • XGameRuntimeIsFeatureAvailable(XAppCapture) now returns true because the feature table follows "served". A title that gates capture on that call will now call in and get E_NOTIMPL where it used to skip capture. That is harmless if it checks the HRESULT. Still, "available" while every method refuses is a choice the doc row should state. (Reasoning; not run.)
  • The doc paragraph still lists two pull request numbers carried over from the old text; check they are current numbers.

Not tested: the C++ test on Windows, and the retail executable's actual call (needs game files).


Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 07:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537#issuecomment-7125512803) Review of head df1800d47f37eb6178fa658bf2afa79830ca00a9 (read-only; Linux, Python 3, no Windows/MSVC). What ran: - `python3 -I tests/test_gdk_runtime_calls.py`: 23 tests, OK (including the updated `kAppCaptureClass` served assertion). - Not built: `xgameruntime.cpp` and `xgameruntime_test.cpp` include `<windows.h>`, so they cannot be built here. Checked against the repository: - Class id `a4f1aee2-...` and the IIDs for Impl2 `3a949778-...`, Impl3 `2bbca60a-...` and Impl4 `22e672d7-...` match `tools/gdk_runtime_classes.json`. The class id is also `IXAppCaptureImpl`'s IID there, and `object_query_interface` accepts `*class_id`, so v1 is served without being in `kAppCaptureIids`. - Vtable order 3-17 matches the method lists in that json (8 + 4 + 2 + 1 = 15, plus IUnknown = 18, as the static_assert says). Slot 5 is `XAppCaptureTakeScreenshot`, as `docs/runtime_imports.md` records for the executable. - Offline safety (reasoning): every slot returns `E_NOTIMPL` and writes nothing. On x64 a one-argument stub is safe for callers that pass more arguments. A caller that checks the HRESULT skips the call, and the out structs are left untouched, which is no worse than the previous null object. Points to consider: - `XGameRuntimeIsFeatureAvailable(XAppCapture)` now returns true because the feature table follows "served". A title that gates capture on that call will now call in and get `E_NOTIMPL` where it used to skip capture. That is harmless if it checks the HRESULT. Still, "available" while every method refuses is a choice the doc row should state. (Reasoning; not run.) - The doc paragraph still lists two pull request numbers carried over from the old text; check they are current numbers. Not tested: the C++ test on Windows, and the retail executable's actual call (needs game files). --- _Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account._
Author
Owner

@⁠tengotengo on GitHub · 2026-11-24 09:59 UTC · original

Thanks - both points addressed in d323506b8 (docs-only):

  • The served-classes note no longer cites #4235/#4248. I checked: neither exists in this repository (404 as a pull request or an issue) - they name pull requests of the deleted predecessor repository. The live PR serving XAccessibilityImpl and XLauncherImpl is #401 (RT-GDK-SPEECH-DISPLAY-LIFECYCLE), and the note now names it.
  • The XGameRuntimeFeatureImpl row now states the E_NOTIMPL nuance: for XAppCapture, "served" means the class id and the v1-v4 interface ids answer QueryApiImpl while every method of the offline object returns E_NOTIMPL - the feature is reported available, capture itself is not.

One more thing while we are here: #401 also serves XAppCaptureImpl (in xgameruntime_offline.cpp, TakeScreenshot -> ERROR_NOT_SUPPORTED) and updates the same xgameruntime_test.cpp / test_gdk_runtime_calls.py / docs/runtime_imports.md. If both merge, class a4f1aee2-4bf1-4485-b008-a7c26d52ac27 is served by two objects, and the shared files conflict on the second merge. I commented on #401 to coordinate: this PR's layout was measured against the retail executable (the class id, the v4 interface id it requests, and slot 5 - the executable's one thunk of the class), so I would keep #537 as the serving side.

**@⁠tengotengo** on GitHub · 2026-11-24 09:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537#issuecomment-7128155099) Thanks - both points addressed in d323506b8 (docs-only): - The served-classes note no longer cites #4235/#4248. I checked: neither exists in this repository (404 as a pull request or an issue) - they name pull requests of the deleted predecessor repository. The live PR serving XAccessibilityImpl and XLauncherImpl is #401 (RT-GDK-SPEECH-DISPLAY-LIFECYCLE), and the note now names it. - The XGameRuntimeFeatureImpl row now states the E_NOTIMPL nuance: for XAppCapture, "served" means the class id and the v1-v4 interface ids answer QueryApiImpl while every method of the offline object returns E_NOTIMPL - the feature is reported available, capture itself is not. One more thing while we are here: #401 also serves XAppCaptureImpl (in xgameruntime_offline.cpp, TakeScreenshot -> ERROR_NOT_SUPPORTED) and updates the same xgameruntime_test.cpp / test_gdk_runtime_calls.py / docs/runtime_imports.md. If both merge, class a4f1aee2-4bf1-4485-b008-a7c26d52ac27 is served by two objects, and the shared files conflict on the second merge. I commented on #401 to coordinate: this PR's layout was measured against the retail executable (the class id, the v4 interface id it requests, and slot 5 - the executable's one thunk of the class), so I would keep #537 as the serving side.
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 14:48 UTC · original

Re-review of head d323506b83eaa610b7d42762c7697dd68b219932 (the one commit since my review: d323506, docs only).

What I re-checked:

  • git diff df1800d..d323506.
  • python -I tests/test_gdk_runtime_calls.py at the head: 23 tests OK.
  • The PR merged onto current main f3e26be7c in a scratch worktree: no textual conflict, and the same Python test passes (23 OK).
  • scripts/check_no_game_data.py on the changed files: clean.
  • Not built: the C++ xgameruntime_test (needs Windows/MSVC).

Earlier remarks:

  1. XGameRuntimeIsFeatureAvailable(XAppCapture) true while every method is E_NOTIMPL: resolved. The XGameRuntimeFeatureImpl row now says this.
  2. Stale PR numbers in the served-classes note: resolved as written at the time. #4235 / #4248 are replaced. However, the new text is already out of date, see below.

Overlap with #401, as of now:

  • #401's first head (43c4f104, 04:43Z) did serve XAppCaptureImpl in xgameruntime_offline.cpp and touched the same test and doc files.
  • Its last commit (d7354f2b, 13:33Z, "drop XAppCaptureImpl ... (#401 review)") removed it. #401 was merged at 13:44Z as 05318a38.
  • On main now, class a4f1aee2-4bf1-4485-b008-a7c26d52ac27 is served by nothing. xgameruntime_test.cpp:265 and test_gdk_runtime_calls.py:420 assert that it is refused. This PR changes both of those to "served".
  • So the two-object overlap no longer exists. For a maintainer, what is left is only whether to take this PR as the one place that serves the class.

Still open in this PR's docs (docs/runtime_imports.md around lines 551-554 after merging onto main): "Open pull request #401 ... serves both; it also serves XAppCaptureImpl, which overlaps g_app_capture ... the overlap is noted on #401" is no longer true, because #401 is merged and dropped the class. The sentence about the predecessor repository's numbers could go too. Please rebase and rewrite that paragraph for current main.

AI-assisted.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 14:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537#issuecomment-7134974669) Re-review of head `d323506b83eaa610b7d42762c7697dd68b219932` (the one commit since my review: `d323506`, docs only). What I re-checked: - `git diff df1800d..d323506`. - `python -I tests/test_gdk_runtime_calls.py` at the head: 23 tests OK. - The PR merged onto current main `f3e26be7c` in a scratch worktree: no textual conflict, and the same Python test passes (23 OK). - `scripts/check_no_game_data.py` on the changed files: clean. - Not built: the C++ `xgameruntime_test` (needs Windows/MSVC). Earlier remarks: 1. `XGameRuntimeIsFeatureAvailable(XAppCapture)` true while every method is `E_NOTIMPL`: resolved. The `XGameRuntimeFeatureImpl` row now says this. 2. Stale PR numbers in the served-classes note: resolved as written at the time. `#4235` / `#4248` are replaced. However, the new text is already out of date, see below. Overlap with #401, as of now: - #401's first head (`43c4f104`, 04:43Z) did serve `XAppCaptureImpl` in `xgameruntime_offline.cpp` and touched the same test and doc files. - Its last commit (`d7354f2b`, 13:33Z, "drop XAppCaptureImpl ... (#401 review)") removed it. #401 was merged at 13:44Z as `05318a38`. - On main now, class `a4f1aee2-4bf1-4485-b008-a7c26d52ac27` is served by nothing. `xgameruntime_test.cpp:265` and `test_gdk_runtime_calls.py:420` assert that it is refused. This PR changes both of those to "served". - So the two-object overlap no longer exists. For a maintainer, what is left is only whether to take this PR as the one place that serves the class. Still open in this PR's docs (`docs/runtime_imports.md` around lines 551-554 after merging onto main): "Open pull request #401 ... serves both; it also serves `XAppCaptureImpl`, which overlaps `g_app_capture` ... the overlap is noted on #401" is no longer true, because #401 is merged and dropped the class. The sentence about the predecessor repository's numbers could go too. Please rebase and rewrite that paragraph for current main. AI-assisted.
Author
Owner

@⁠tengotengo on GitHub · 2026-11-24 17:29 UTC · original

Rebased onto a28927849 (post-#401 main) and re-verified; the branch is ready at 2581f6da8 but the force-push is momentarily held by our token missing the workflow scope (the rebased tip carries main's updated .github/workflows/runtime.yml, which a repo-scoped classic PAT can't update). The only change on top of the rebase is the final paragraph of docs/runtime_imports.md, rewritten for post-#401 main (XAppCaptureImpl served by this change via g_app_capture; XAccessibilityImpl/XLauncherImpl served in xgameruntime_offline.cpp by merged #401, 05318a387; the stale "overlap with #401" sentence and the predecessor-repo numbers are gone). The code — 18-slot IXAppCaptureImpl..4 vtable, all methods E_NOTIMPL, the 3 new test checks, the flipped assertion — is unchanged.

Re-verified after the rebase: xgameruntime_test under Wine 11.21 — all 161 checks pass (incl. slot-5 refusal + class-id/v4-interface checks); tests/test_gdk_runtime_calls.py 23/23; 12/12 test_docs; full ctest failure set under Wine identical with vs without the change (22/301, the documented headless-Wine environment failures); check_no_game_data clean. gdk_runtime_calls.py on the exe: 158/158 referenced thunks served, none unserved. Pushing the moment the token gains the scope — no other changes needed.

**@⁠tengotengo** on GitHub · 2026-11-24 17:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537#issuecomment-7139268907) Rebased onto a28927849 (post-#401 main) and re-verified; the branch is ready at 2581f6da8 but the force-push is momentarily held by our token missing the `workflow` scope (the rebased tip carries main's updated .github/workflows/runtime.yml, which a repo-scoped classic PAT can't update). The only change on top of the rebase is the final paragraph of docs/runtime_imports.md, rewritten for post-#401 main (XAppCaptureImpl served by this change via g_app_capture; XAccessibilityImpl/XLauncherImpl served in xgameruntime_offline.cpp by merged #401, 05318a387; the stale "overlap with #401" sentence and the predecessor-repo numbers are gone). The code — 18-slot IXAppCaptureImpl..4 vtable, all methods E_NOTIMPL, the 3 new test checks, the flipped assertion — is unchanged. Re-verified after the rebase: xgameruntime_test under Wine 11.21 — all 161 checks pass (incl. slot-5 refusal + class-id/v4-interface checks); tests/test_gdk_runtime_calls.py 23/23; 12/12 test_docs; full ctest failure set under Wine identical with vs without the change (22/301, the documented headless-Wine environment failures); check_no_game_data clean. gdk_runtime_calls.py on the exe: 158/158 referenced thunks served, none unserved. Pushing the moment the token gains the scope — no other changes needed.
Author
Owner

@⁠tengotengo on GitHub · 2026-11-24 18:38 UTC · original

Reopened with the rebase pushed — head is now 2581f6da8 (on main a28927849, and our four touched files are unchanged on main up to the current tip). The only content change vs d323506b8 is the rewritten final paragraph of docs/runtime_imports.md (per the 14:48Z review): XAppCaptureImpl served by this change via g_app_capture; XAccessibilityImpl/XLauncherImpl served in xgameruntime_offline.cpp by merged #401 (05318a387). Verification re-run after the rebase: xgameruntime_test under Wine — 161/161; tests/test_gdk_runtime_calls.py 23/23; 12/12 test_docs; ctest failure set identical with vs without the change (22/301, documented headless-Wine environment failures); check_no_game_data clean.

**@⁠tengotengo** on GitHub · 2026-11-24 18:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/537#issuecomment-7140925282) Reopened with the rebase pushed — head is now 2581f6da8 (on main a28927849, and our four touched files are unchanged on main up to the current tip). The only content change vs d323506b8 is the rewritten final paragraph of docs/runtime_imports.md (per the 14:48Z review): XAppCaptureImpl served by this change via g_app_capture; XAccessibilityImpl/XLauncherImpl served in xgameruntime_offline.cpp by merged #401 (05318a387). Verification re-run after the rebase: xgameruntime_test under Wine — 161/161; tests/test_gdk_runtime_calls.py 23/23; 12/12 test_docs; ctest failure set identical with vs without the change (22/301, documented headless-Wine environment failures); check_no_game_data clean.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/537/head:github-bot/gh-537'
git switch 'github-bot/gh-537'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-537'
git switch 'github-bot/gh-537'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-537'
git switch 'github-bot/gh-537'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-537'
git switch 'main'
git merge --squash 'github-bot/gh-537'
git switch 'main'
git merge --ff-only 'github-bot/gh-537'
git switch 'main'
git merge 'github-bot/gh-537'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.