Skip to main content

XUserGetGamertag

Retrieves the gamertag for a specific user.

Syntax

Parameters

user   _In_
Type: XUserHandle
A handle to the user to retrieve the gamertag for. gamertagComponent   _In_
Type: XUserGamertagComponent
Type of gamertag to retrieve. gamertagSize   _In_
Type: size_t
Size in bytes of the buffer in the gamertag parameter. gamertag   _Out_writes_bytes_to_(gamertagSize,gamertagUsed)
Type: char
Contains the gamertag for a specific user. gamertagUsed   _Out_opt_
Type: size_t*
Contains the amount of the buffer for holding the gamertag.

Return value

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

Remarks

To retrieve the user ID for a specific user, call XUserGetId. To retrieve the state of a specific user, call XUserGetState. To retrieve the age group for a specific user, call XUserGetAgeGroup.

Requirements

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

See also

XUser XUserGetId XUserGetState XUserGetAgeGroup
Last modified on August 20, 2026