xgameruntime: implement XUserGetTokenAndSignatureAsync and result functions #54

Open
github-bot wants to merge 1 commit from github-bot/gh-54 into main AGit
Owner

@⁠bulkynomad on GitHub · 2026-11-26 07:11 UTC · original
bulkynomad:feat/xuser-token-and-signature → main · +271 −38 · 10 files · 1 commits · open

Summary

This PR implements \XUserGetTokenAndSignatureAsync, \XUserGetTokenAndSignatureResultSize, and \XUserGetTokenAndSignatureResult, resolving the open callout documented in \generate_status.py\ and \README.md.

Changes

  1. GDK ABI Declarations (\include/scarlettx/gdk/xgameruntime_abi.h):

    • Added \XUserGetTokenAndSignatureOptions\ enum (\None, \ForceRefresh, \Deferred).
    • Added \XUserGetTokenAndSignatureHttpHeader\ and \XUserGetTokenAndSignatureData\ structures conforming to the GDK specification.
    • Declared exported APIs: \XUserGetTokenAndSignatureAsync, \XUserGetTokenAndSignatureResultSize, and \XUserGetTokenAndSignatureResult.
  2. HLE Implementation (\src/shims/xgameruntime_shim.cpp):

    • \XUserGetTokenAndSignatureAsync: Validates user and async handles, builds a deterministic synthetic offline token (\XBL3.0 x=;synthetic_offline_token) and signature payload, and schedules the completion through \BeginAsyncOperation.
    • \XUserGetTokenAndSignatureResultSize: Returns the total required buffer size for \XUserGetTokenAndSignatureData\ and null-terminated strings.
    • \XUserGetTokenAndSignatureResult: Serializes the result structure and UTF-8 strings into the caller-provided buffer, checks for \XGR_E_NOT_SUFFICIENT_BUFFER, and cleans up the HLE async state.
  3. COM Interface Table (\src/shims/xgr_api_tables.cpp):

    • Added COM callback thunks: \UserGetTokenAndSignatureAsync, \UserGetTokenAndSignatureResultSize, and \UserGetTokenAndSignatureResult.
    • Bound slots 23, 24, and 25 in \MakeUserVtbl\ for {01ACD177}.
  4. Testing & Status:

    • Added synthetic test coverage in \ ests/test_xgameruntime_abi.cpp.
    • Added slot verification (\
**@⁠bulkynomad** on GitHub · 2026-11-26 07:11 UTC · [original](https://github.com/Freminet/ScarlettX/pull/54) `bulkynomad:feat/xuser-token-and-signature` → `main` · +271 −38 · 10 files · 1 commits · open ### Summary This PR implements \XUserGetTokenAndSignatureAsync\, \XUserGetTokenAndSignatureResultSize\, and \XUserGetTokenAndSignatureResult\, resolving the open callout documented in \generate_status.py\ and \README.md\. ### Changes 1. **GDK ABI Declarations (\include/scarlettx/gdk/xgameruntime_abi.h\)**: - Added \XUserGetTokenAndSignatureOptions\ enum (\None\, \ForceRefresh\, \Deferred\). - Added \XUserGetTokenAndSignatureHttpHeader\ and \XUserGetTokenAndSignatureData\ structures conforming to the GDK specification. - Declared exported APIs: \XUserGetTokenAndSignatureAsync\, \XUserGetTokenAndSignatureResultSize\, and \XUserGetTokenAndSignatureResult\. 2. **HLE Implementation (\src/shims/xgameruntime_shim.cpp\)**: - \XUserGetTokenAndSignatureAsync\: Validates user and async handles, builds a deterministic synthetic offline token (\XBL3.0 x=<xuid>;synthetic_offline_token\) and signature payload, and schedules the completion through \BeginAsyncOperation\. - \XUserGetTokenAndSignatureResultSize\: Returns the total required buffer size for \XUserGetTokenAndSignatureData\ and null-terminated strings. - \XUserGetTokenAndSignatureResult\: Serializes the result structure and UTF-8 strings into the caller-provided buffer, checks for \XGR_E_NOT_SUFFICIENT_BUFFER\, and cleans up the HLE async state. 3. **COM Interface Table (\src/shims/xgr_api_tables.cpp\)**: - Added COM callback thunks: \UserGetTokenAndSignatureAsync\, \UserGetTokenAndSignatureResultSize\, and \UserGetTokenAndSignatureResult\. - Bound slots 23, 24, and 25 in \MakeUserVtbl\ for \{01ACD177}\. 4. **Testing & Status**: - Added synthetic test coverage in \ ests/test_xgameruntime_abi.cpp\. - Added slot verification (\
- Add XUserGetTokenAndSignatureOptions, XUserGetTokenAndSignatureHttpHeader, and XUserGetTokenAndSignatureData to xgameruntime_abi.h
- Implement XUserGetTokenAndSignatureAsync with deterministic synthetic offline token and signature payload
- Implement XUserGetTokenAndSignatureResultSize and XUserGetTokenAndSignatureResult with buffer size validation and HLE state lifecycle management
- Bind slots 23, 24, and 25 in MakeUserVtbl for {01ACD177}
- Add ABI verification in test_xgameruntime_abi and QueryApiImpl slot verification in test_query_api_impl
- Update status generator and documentation
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:57:05 +00:00
This pull request can be merged automatically.
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/54/head:github-bot/gh-54'
git switch 'github-bot/gh-54'

Merge

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