Skip to main content

XUserFindUserByLocalId

Retrieves a handle to the user for a specific local user ID.

Syntax

Parameters

userLocalId   _In_
Type: XUserLocalId
The local ID to get the user for. handle   _Out_
Type: XUserHandle*
Contains a handle to the user associated with a specific local user ID.

Return value

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
Type: HRESULT HRESULT success or error code.

Remarks

For each XUserHandle handle that you retrieve from an XUser API, inluding XUserFindUserByLocalId, you must close that handle calling XUserCloseHandle. The reference count of the handle increases after calling Get / Find functions. To retrieve a handle to a user for a specific local user ID, call XUserFindUserByLocalId. To retrieve the XBOX User ID (XUID) for a local user, call XUserFindUserById. 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 XUserFindUserById XUserFindForDevice
Last modified on August 20, 2026