Skip to main content

XUserGetId

Gets the user ID for a specific user.

Syntax

Parameters

user   _In_
Type: XUserHandle
A handle to the user to retrieve the user ID for. userId   _Out_
Type: uint64_t*
Contains the user ID for a specific user.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

Retrieves the user’s XUID. If the function returns E_GAMEUSER_RESOLVE_USER_ISSUE_REQUIRED, the user needs to use the system UI to resolve the problem before the function can retrieve the property. Call XUserResolveIssueWithUiAsync to display the system UI and resolve the issue.

Requirements

Header: XUser.h Library: xgameruntime.lib Supported platforms: Windows, Steam Deck, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XUser XUserFindUserById XUserFindUserByLocalId
Last modified on August 20, 2026