Skip to main content

XUserFindUserById

根據本機使用者的 XBOX 使用者識別碼 (XUID) 擷取 XUserHandle。

語法

參數

userId   _In_
類型:uint64_t
要擷取其 XUID 的本機使用者。 handle   _Out_
類型:XUserHandle*
包含本機使用者的 XUID。

傳回值

類型:HRESULT HRESULT 成功或錯誤碼。
如需錯誤碼清單,請參閱錯誤碼。

備註

在時間敏感執行緒上呼叫此函式並不安全。如需詳細資訊,請參閱時間敏感執行緒。
對於從 XUser API (包括 XUserFindUserById) 擷取的每個 XUserHandle 控制代碼,您都必須 呼叫 XUserCloseHandle 來關閉該控制代碼。 若要擷取本機使用者的 XBox 使用者識別碼 (XUID),請呼叫 XUserFindUserById。 若要擷取特定本機使用者識別碼的使用者控制代碼,請呼叫 XUserFindUserByLocalId。 若要擷取特定裝置識別碼的使用者識別碼,請呼叫 XUserFindForDevice。

需求

標頭: XUser.h 程式庫: xgameruntime.lib 支援的平台: Windows、Steam Deck、XBOX One 系列主機和 XBOX Series 主機

概念文件

另請參閱

XUser XUserFindUserByLocalId XUserFindForDevice
Last modified on October 6, 2026