Skip to main content

XUserFindUserById

Retrieves the XUserHandle based on the XBOX User ID (XUID) of a local user.

Syntax

Parameters

userId   _In_
Type: uint64_t
The local user to retrieve the XUID for. handle   _Out_
Type: XUserHandle*
Contains the XUID for the local user.

Return value

Type: HRESULT HRESULT success or error code.
For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
For each XUserHandle handle that you retrieve from an XUser API, inluding XUserFindUserById, you must close that handle calling XUserCloseHandle. To retrieve the XBox User ID (XUID) for a local user, call XUserFindUserById. To retrieve a handle to a user for a specific local user ID, call XUserFindUserByLocalId. To retrieve a user ID for a specific device ID, call XUserFindForDevice.

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 XUserFindUserByLocalId XUserFindForDevice
Last modified on August 20, 2026