startup: implement XGameSaveEnumerateBlobInfo and XGameSaveEnumerateBlobInfoByName in xgameruntime (Part of #1334) #2285

Merged
tedin7 merged 2 commits from upstream-pr/2293 into main 2026-11-25 11:02:11 +00:00
tedin7 commented 2026-11-25 10:27:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:27:57Z.


Part of #1334

What this unblocks: titles that list the blobs of a save container (to size a read or check for required blobs) can now do so through XGameSaveEnumerateBlobInfo and XGameSaveEnumerateBlobInfoByName in the xgameruntime stand-in, before calling the existing XGameSaveReadBlobData.

What changed

  • src/xgameruntime_shim.cpp: two new implemented rows in the thunk table, using the public XGameSaveBlobInfoCallback (bool(const XGameSaveBlobInfo*, void*); false stops the walk).
    • Matching names and sizes are copied under the shared lock; the callback runs after it is released, so it may call back into the shim.
    • By-name matches a case-sensitive prefix; an empty prefix matches all.
    • Null container, prefix or callback: E_INVALIDARG. Closed handle: E_HANDLE. Handle of a closed provider: refused.
  • tests/xgameruntime_gamesave_enumerate_check.cpp + CMake test xgameruntime_gamesave_enumerate: empty container, three blobs, prefix hit/miss/case/too-long, empty prefix, early stop, re-entrant callback, sibling-container isolation, closed handle, closed provider.
  • docs/experiments.md: behavior and build/test line.

Out of scope: container enumeration and asynchronous reads. Signature reference: https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgamesave/functions/xgamesaveenumerateblobinfo

Verification (Linux only; Win2025 WARP dev+release is for Stage-2)

  • python3 -B tests/docs_links_check.py: pass (18 files, 436 links)
  • python3 -B tests/xgameruntime_table_check.py: PASS
  • git diff --check: clean
  • Cross-compiled shim and the new check with x86_64-w64-mingw32-g++ -std=c++17 (no warnings in the shim); the check printed PASS when run with the shim DLL under a local Wine.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6602385071 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2293). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:27:57Z. --- Part of #1334 What this unblocks: titles that list the blobs of a save container (to size a read or check for required blobs) can now do so through `XGameSaveEnumerateBlobInfo` and `XGameSaveEnumerateBlobInfoByName` in the xgameruntime stand-in, before calling the existing `XGameSaveReadBlobData`. ## What changed - `src/xgameruntime_shim.cpp`: two new implemented rows in the thunk table, using the public `XGameSaveBlobInfoCallback` (`bool(const XGameSaveBlobInfo*, void*)`; `false` stops the walk). - Matching names and sizes are copied under the shared lock; the callback runs after it is released, so it may call back into the shim. - By-name matches a case-sensitive prefix; an empty prefix matches all. - Null container, prefix or callback: `E_INVALIDARG`. Closed handle: `E_HANDLE`. Handle of a closed provider: refused. - `tests/xgameruntime_gamesave_enumerate_check.cpp` + CMake test `xgameruntime_gamesave_enumerate`: empty container, three blobs, prefix hit/miss/case/too-long, empty prefix, early stop, re-entrant callback, sibling-container isolation, closed handle, closed provider. - `docs/experiments.md`: behavior and build/test line. Out of scope: container enumeration and asynchronous reads. Signature reference: https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgamesave/functions/xgamesaveenumerateblobinfo ## Verification (Linux only; Win2025 WARP dev+release is for Stage-2) - `python3 -B tests/docs_links_check.py`: pass (18 files, 436 links) - `python3 -B tests/xgameruntime_table_check.py`: PASS - `git diff --check`: clean - Cross-compiled shim and the new check with `x86_64-w64-mingw32-g++ -std=c++17` (no warnings in the shim); the check printed PASS when run with the shim DLL under a local Wine. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 11:02:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:49:00Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit cc6e6544678e274a6d05dc2cdec30fbf440d44a2:

  • Debug (--preset dev): build of the xgameruntime targets, then ctest --preset dev -R '^(xgameruntime_async_status|xgameruntime_contracts|xgameruntime_gamesave_async|xgameruntime_gamesave_enumerate|xgameruntime_identity|xgameruntime_pls_xpackage|xgameruntime_preflight_stub_refused|xgameruntime_thunks|xgameruntime_user_async)$' --no-tests=error: 9/9 passed.
  • Release /O2 (--preset release): same targets and same ctest regex: 9/9 passed.
  • GitHub CI: all executed checks pass (Windows build/test, Linux Python checks, gfx1013 fixtures).
  • Hygiene audit of title, body, commits and diff: clean.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160211094 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2293#issuecomment-7160211094). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T10:49:00Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `cc6e6544678e274a6d05dc2cdec30fbf440d44a2`: - Debug (`--preset dev`): build of the xgameruntime targets, then `ctest --preset dev -R '^(xgameruntime_async_status|xgameruntime_contracts|xgameruntime_gamesave_async|xgameruntime_gamesave_enumerate|xgameruntime_identity|xgameruntime_pls_xpackage|xgameruntime_preflight_stub_refused|xgameruntime_thunks|xgameruntime_user_async)$' --no-tests=error`: 9/9 passed. - Release `/O2` (`--preset release`): same targets and same ctest regex: 9/9 passed. - GitHub CI: all executed checks pass (Windows build/test, Linux Python checks, gfx1013 fixtures). - Hygiene audit of title, body, commits and diff: clean. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 11:02:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T10:49:13Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T10:52:49.390003Z cc6e654 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160215733 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2293#issuecomment-7160215733). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T10:49:13Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"cc6e6544678e274a6d05dc2cdec30fbf440d44a2","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T10:52:49.390003Z">2026-11-25T10:52:49.390003Z</relative-time> | `cc6e654` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-25 12:01:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
R0Y00/Xbox2Windows!2285
No description provided.