Repository navigation
xgameruntime: XUserFindForDevice answers E_GAMEUSER_USER_NOT_FOUND until XUserAddAsync (OLD-9860 / RT-382) - #1137
Conversation
…til XUserAddAsync (RT-382) The GDK reference says XUserFindForDevice cannot return a user handle to a user that was not signed in with a call to XUserAddAsync. Track whether the offline user was added (XUserAddAsync, or the local user by id) and answer E_GAMEUSER_USER_NOT_FOUND with no handle before that. The HRESULT is an assumption: the reference names no code. docs/runtime_imports.md updated; the offline test asks before and after the add. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> # Conflicts: # docs/runtime_imports.md # runtime/test/xgameruntime_offline_test.cpp
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Conforms XUserFindForDevice to GDK specification by clearing *out = nullptr and returning E_GAMEUSER_USER_NOT_FOUND prior to XUserAddAsync sign-in. Verified with xgameruntime_offline_test.exe (72/72 PASS). 100% clean-room.
|
Tested
AI-assisted: yes |
|
Recommendation: [MERGE] Reasoning: Carries #126: Impact level: 3/10 |
Claimed in the coordination issue as: OLD-9860 (#14 (comment))
What and why
Carries forward
old-pr/9860(draft #126, original commit authorSalim Hammamipreserved; indexed in #17; RT-382), rebased cleanly onto currentmain(6293c1c4f).Matches the GDK
XUserFindForDevicecontract ("cannot return a user handle to a user that hasn't been signed in with a call toXUserAddAsync"):g_user_addedinruntime/shims/xgameruntime_user.cpp, set onXUserAddAsyncand onXUserAddByIdWithUiAsyncfor the local user).XUserFindForDevice(runtime/shims/xgameruntime_offline.cpp) clears*out = nullptrand returnsE_GAMEUSER_USER_NOT_FOUNDuntil the user has been added, then returns a newXUserHandleafterward.docs/runtime_imports.md(marking the HRESULT choice as an explicitASSUMPTION) and extendsruntime/test/xgameruntime_offline_test.cppto assert behavior both before and afterXUserAddAsync.Tested
xgameruntime_offline_test.exenatively 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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a —xgameruntimeshim)