[PR #1137] xgameruntime: XUserFindForDevice answers E_GAMEUSER_USER_NOT_FOUND until XUserAddAsync (OLD-9860 / RT-382) #1171

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

📋 Pull Request Information

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

Base: main ← Head: carry/old-9860-xuser-find-device


📝 Commits (1)

  • d93d8ed xgameruntime: XUserFindForDevice answers E_GAMEUSER_USER_NOT_FOUND until XUserAddAsync (RT-382)

📊 Changes

4 files changed (+40 additions, -7 deletions)

View changed files

📝 docs/runtime_imports.md (+5 -2)
📝 runtime/shims/xgameruntime_offline.cpp (+9 -1)
📝 runtime/shims/xgameruntime_user.cpp (+8 -0)
📝 runtime/test/xgameruntime_offline_test.cpp (+18 -4)

📄 Description

Claimed in the coordination issue as: OLD-9860 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141626851)

What and why

Carries forward old-pr/9860 (draft #126, original commit author Salim Hammami preserved; indexed in #17; RT-382), rebased cleanly onto current main (6293c1c4f).

Matches the GDK XUserFindForDevice contract ("cannot return a user handle to a user that hasn't been signed in with a call to XUserAddAsync"):

  • Tracks whether the offline user has been added (g_user_added in runtime/shims/xgameruntime_user.cpp, set on XUserAddAsync and on XUserAddByIdWithUiAsync for the local user).
  • XUserFindForDevice (runtime/shims/xgameruntime_offline.cpp) clears *out = nullptr and returns E_GAMEUSER_USER_NOT_FOUND until the user has been added, then returns a new XUserHandle afterward.
  • Updates docs/runtime_imports.md (marking the HRESULT choice as an explicit ASSUMPTION) and extends runtime/test/xgameruntime_offline_test.cpp to assert behavior both before and after XUserAddAsync.

Tested

  • Compiled and ran xgameruntime_offline_test.exe natively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2): xgameruntime_offline_test: 72 checks, 0 failures.
  • python -I tests/test_docs_links.py: 16 tests, OK.
  • python -I scripts/check_no_game_data.py docs/runtime_imports.md runtime/shims/xgameruntime_offline.cpp runtime/shims/xgameruntime_user.cpp runtime/test/xgameruntime_offline_test.cpp: exit 0 (no game data).

GPUs tested: n/a (CPU/OS runtime shim; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a — xgameruntime shim)

🔄 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/1137 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9860-xuser-find-device` --- ### 📝 Commits (1) - [`d93d8ed`](https://github.com/ubiquitarianism/leonida/commit/d93d8ed0ec466d2ff7d2205209d2f008a6ef4f22) xgameruntime: XUserFindForDevice answers E_GAMEUSER_USER_NOT_FOUND until XUserAddAsync (RT-382) ### 📊 Changes **4 files changed** (+40 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/runtime_imports.md` (+5 -2) 📝 `runtime/shims/xgameruntime_offline.cpp` (+9 -1) 📝 `runtime/shims/xgameruntime_user.cpp` (+8 -0) 📝 `runtime/test/xgameruntime_offline_test.cpp` (+18 -4) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9860 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141626851) ### What and why Carries forward `old-pr/9860` (draft #126, original commit author `Salim Hammami` preserved; indexed in #17; RT-382), rebased cleanly onto current `main` (`6293c1c4f`). Matches the GDK `XUserFindForDevice` contract ("cannot return a user handle to a user that hasn't been signed in with a call to `XUserAddAsync`"): - Tracks whether the offline user has been added (`g_user_added` in `runtime/shims/xgameruntime_user.cpp`, set on `XUserAddAsync` and on `XUserAddByIdWithUiAsync` for the local user). - `XUserFindForDevice` (`runtime/shims/xgameruntime_offline.cpp`) clears `*out = nullptr` and returns `E_GAMEUSER_USER_NOT_FOUND` until the user has been added, then returns a new `XUserHandle` afterward. - Updates `docs/runtime_imports.md` (marking the HRESULT choice as an explicit `ASSUMPTION`) and extends `runtime/test/xgameruntime_offline_test.cpp` to assert behavior both before and after `XUserAddAsync`. ### Tested - Compiled and ran `xgameruntime_offline_test.exe` natively on Windows 11 with MSVC (`/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2`): `xgameruntime_offline_test: 72 checks, 0 failures`. - `python -I tests/test_docs_links.py`: 16 tests, OK. - `python -I scripts/check_no_game_data.py docs/runtime_imports.md runtime/shims/xgameruntime_offline.cpp runtime/shims/xgameruntime_user.cpp runtime/test/xgameruntime_offline_test.cpp`: exit 0 (no game data). GPUs tested: n/a (CPU/OS runtime shim; built and tested on Windows 11 Pro 64-bit, MSVC VS 18) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [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. (n/a — `xgameruntime` shim) --- <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#1171
No description provided.