> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblContextGetUser

> XblContextGetUser

# XblContextGetUser

Get the XblContextHandle associated with this context.

## Syntax

```cpp theme={null}
HRESULT XblContextGetUser(  
         XblContextHandle context,  
         XblUserHandle* user  
)  
```

### Parameters

*context*   \_In\_\
Type: [XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

The XBOX Live context handle.

*user*   \_Out\_\
Type: XblUserHandle\*

Passes back the XBOX Live user handle. XSAPI will call XalUserDuplicateHandle before returning the handle, so it is the responsibility of the caller to later call XalUserCloseHandle.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Requirements

**Header:** xbox\_live\_context\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[xbox\_live\_context\_c](/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members)


## Related topics

- [XblContextGetXboxUserId](/reference/live/xsapi-c/xbox_live_context_c/functions/xblcontextgetxboxuserid.md)
- [PartyXblChatUser::GetCustomContext](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getcustomcontext.md)
- [XblProfileGetUserProfileAsync](/reference/live/xsapi-c/profile_c/functions/xblprofilegetuserprofileasync.md)
- [XblProfileGetUserProfilesAsync](/reference/live/xsapi-c/profile_c/functions/xblprofilegetuserprofilesasync.md)
- [XblUserStatisticsGetSingleUserStatisticAsync](/reference/live/xsapi-c/user_statistics_c/functions/xbluserstatisticsgetsingleuserstatisticasync.md)
