XUser

Reference material for XUser APIs.

Functions

Function Description
XUserAddAsync Asynchronously adds a user to a game session.
XUserAddByIdWithUiAsync Asynchronously adds a user to a game session based on a XUID from a game invite. This function should only be used in response to a game invite.
XUserAddByIdWithUiResult Retrieves a handle to the user that XUserAddByIdWithUiAsync creates. This function should only be used in response to a game invite.
XUserAddResult Retrieves a handle to a user that XUserAddAsync creates.
XUserChangeEventCallback A callback that an application defines for a user change event.
XUserCheckPrivilege Determines if a user has a specific privilege.
XUserCloseHandle Closes a specific user handle.
XUserCloseSignOutDeferralHandle Closes a specific user sign out deferral handle.
XUserCompare Compares two user handles for equality.
XUserDefaultAudioEndpointUtf16ChangedCallback A callback that an application defines and invokes when the default audio endpoint for a user changes.
XUserDeviceAssociationChangedCallback A callback that invokes when the user-device association changes.
XUserDuplicateHandle Duplicates a user handle.
XUserFindControllerForUserWithUiAsync Shows a dialog that will prompt the user to turn on and identify which controller they want to use.
XUserFindControllerForUserWithUiResult Retrieves the application local device ID (APP_LOCAL_DEVICE_ID) that a user has chosen to use.
XUserFindForDevice Retrieves the user ID for a specific device ID.
XUserFindUserById Retrieves the XBox User ID (XUID) for a local user.
XUserFindUserByLocalId Retrieves a handle to the user for a specific local user ID.
XUserGetAgeGroup Returns the age group of a user.
XUserGetDefaultAudioEndpointUtf16 Retrieves the default audio endpoint for a specific user.
XUserGetGamerPictureAsync Asynchronously retrieves the gamer picture for a specific user.
XUserGetGamerPictureResult Retrieves the result of a call to XUserGetGamerPictureAsync.
XUserGetGamerPictureResultSize Returns the buffer size that XUserGetGamerPictureResult requires to retrieve the gamer picture that ]XUserGetGamerPictureAsync](functions/xusergetgamerpictureasync.md) returns.
XUserGetGamertag Retrieves the gamertag for a specific user.
XUserGetId Gets the user ID for a specific user.
XUserGetIsGuest Returns a boolean indicating if a user is a guest.
XUserGetLocalId Retrieves a unique game session id for a user.
XUserGetMaxUsers Retrieves the maximum number of users that a game session allows on the current platform.
XUserGetMsaTokenSilentlyAsync This function is now deprecated.
XUserGetMsaTokenSilentlyResult This function is now deprecated.
XUserGetMsaTokenSilentlyResultSize This function is now deprecated.
XUserGetSignOutDeferral Retrieves a handle to the sign out deferral.
XUserGetState Retrieves the state of a user.
XUserGetTokenAndSignatureAsync Asynchronously retrieves xtokens and signatures for web requests.
XUserGetTokenAndSignatureResult Gets the result of a call to XUserGetTokenAndSignatureAsync.
XUserGetTokenAndSignatureResultSize Gets the buffer size for holding the results of a call to XUserGetTokenAndSignatureAsync.
XUserGetTokenAndSignatureUtf16Async Asynchronously retrieves Unicode xtokens and signatures for web requests.
XUserGetTokenAndSignatureUtf16Result Gets the result of a call to XUserGetTokenAndSignatureUtf16Async.
XUserGetTokenAndSignatureUtf16ResultSize Gets the buffer size for holding the results of a call to XUserGetTokenAndSignatureUtf16Async.
XUserIsStoreUser Checks if the XUser MSA is the same as the MSA signed into the Microsoft Store.
XUserRegisterForChangeEvent Registers a callback for a user change event.
XUserRegisterForDefaultAudioEndpointUtf16Changed Registers a callback that the application defines and invokes when the default audio endpoint changes.
XUserRegisterForDeviceAssociationChanged Registers a callback for user device association change events.
XUserResolveIssueWithUiAsync Displays a system User Interface for solving token issues with a non-unicode URL.
XUserResolveIssueWithUiResult Retrieves the result of a call to XUserResolveIssueWithUiAsync.
XUserResolveIssueWithUiUtf16Async Displays a system User Interface for solving token issues with a specific unicode URL.
XUserResolveIssueWithUiUtf16Result Retrieves the result of a call to XUserResolveIssueWithUiUtf16Async.
XUserResolvePrivilegeWithUiAsync Displays a resolution user interface for required user privileges.
XUserResolvePrivilegeWithUiResult Retrieves the result of a call to XUserResolvePrivilegeWithUiAsync.
XUserUnregisterForChangeEvent Unregisters a previously registered user change callback.
XUserUnregisterForDefaultAudioEndpointUtf16Changed Unregisters a previously-registered default audio endpoint change callback.
XUserUnregisterForDeviceAssociationChanged Unregisters a previously registered user device association change callback.
xUserPlatformRemoteConnectSetEventHandlers Sets the remote connect event handlers
XUserPlatformRemoteConnectCancelPrompt Signal to XUser that the remote connect prompt has been dismissed by the user.
XUserPlatformRemoteConnectShowPromptEventHandler Show prompt for remote connect authentication event handler.
XUserPlatformRemoteConnectClosePromptEventHandler Close prompt for remote authentication event handler.
XUserPlatformSpopPromptEventHandler Show prompt for SPOP operation event handler
XUserPlatformSpopPromptSetEventHandlers Sets the SPOP prompt event handler.
XUserPlatformSpopPromptClearEventHandler Clears the SPOP prompt event handler in XUser.
XUserPlatformSpopPromptComplete Signal to XUser that the user finished interacting with the SPOP prompt.

Structures

Structure Description
APP_LOCAL_DEVICE_ID Specifies the root ID of a local input device.
XUserDeviceAssociationChange Specifies the old and new device associations when a device association changes.
XUserGetTokenAndSignatureData Specifies the xtokens and signatures that we retrieve for web requests.
XUserGetTokenAndSignatureHttpHeader Specifies the HTTP header for a web request.
XUserGetTokenAndSignatureUtf16Data Contains Unicode xtokens and signatures for web requests.
XUserGetTokenAndSignatureUtf16HttpHeader Contains a Unicode HTTP header for a web request.
XUserLocalId Specifies a game session ID for a user.
XUserPlatformRemoteConnectEventHandlers Encapsulates the remote connect event handlers

Enumerations

Enumeration Description
XUserAddOptions Specifies the options for adding a user.
XUserAgeGroup Specifies the age group of a user.
XUserChangeEvent Specifies the type of user change event.
XUserDefaultAudioEndpointKind Specifies whether the user's default audio endpoint renders or captures audio.
XUserGamerPictureSize Specifies the size of the gamer picture in pixels.
XUserGamertagComponent Specifies the type (or component) of gamertag to fetch.
XUserGetMsaTokenSilentlyOptions Options for XUserGetMsaTokenSilentlyOptions.
XUserGetTokenAndSignatureOptions Options for GetUserTokenAndSignatureAsync.
XUserPrivilege Specifies the privileges of a user.
XUserPrivilegeDenyReason Specifies the reason a user could not obtain a privilege.
XUserPrivilegeOptions Specifies the user privilege options.
XUserState Specifies the current state of the user.
XUserPlatformOperationResult Enum defining the results of a client operation
XUserPlatformSpopOperationResult Enum defining the results of a client operation.

Conceptual documentation

See also

System API reference

Error Codes

The following error codes may be returned by XUser APIs. For a complete list, see Error codes.

Code Value Description
E_GAMEUSER_MAX_USERS_ADDED 0x89245100 Cannot add this user because the maximum number of users has been reached.
E_GAMEUSER_SIGNED_OUT 0x89245101 Cannot perform the operation because the user is signed out.
E_GAMEUSER_RESOLVE_USER_ISSUE_REQUIRED 0x89245102 UI is required to resolve an issue with this user.
E_GAMEUSER_DEFERRAL_NOT_AVAILABLE 0x89245103 Not an appropriate time to request deferral.
E_GAMEUSER_USER_NOT_FOUND 0x89245104 User matching the ID was not found.
E_GAMEUSER_NO_TOKEN_REQUIRED 0x89245105 No token is required for this call.
E_GAMEUSER_NO_DEFAULT_USER 0x89245106 No current default user. If you get this error, call XUserAddAsync again without AddDefaultUserSilently.
E_GAMEUSER_FAILED_TO_RESOLVE 0x89245107 Failed to resolve the given privilege.
E_GAMEUSER_NO_TITLE_ID 0x89245108 An Xbox Live TitleId must be configured.
E_GAMEUSER_UNKNOWN_GAME_IDENTITY 0x89245109 The game identity is not recognized. The MSAAppId and TitleId do not match the ones associated to the game.
E_GAMEUSER_NO_PACKAGE_IDENTITY 0x89245110 A package identity must be configured.
E_GAMEUSER_FAILED_TO_GET_TOKEN 0x89245111 The token request failed.
E_GAMEUSER_INVALID_APP_CONFIGURATION 0x89245112 The MSAAppId in the game config is invalid or not configured for the authentication stack.
E_GAMEUSER_MALFORMED_MSAAPPID 0x89245113 The MSAAppId in the game config does not match the expected format (16 character string or GUID).
E_GAMEUSER_INCONSISTENT_MSAAPPID_AND_TITLEID 0x89245114 The MSAAppId and TitleId in the game config do not match the ones associated to the game.