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

# XblContextGetUser

> XblContextGetUser

Get the XblContextHandle associated with this context.

## Syntax

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

### Parameters

*context*   \_In\_\
Type: [XblContextHandle](https://docs.xbox.com/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

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.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[xbox\_live\_context\_c](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members.md)


## Related topics

- [xbox_live_context_c (contents)](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/xbox_live_context_c_members.md)
- [XblContextGetXboxUserId](https://docs.xbox.com/reference/live/xsapi-c/xbox_live_context_c/functions/xblcontextgetxboxuserid.md)
- [PartyXblChatUser::GetCustomContext](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getcustomcontext.md)
- [XblProfileGetUserProfileAsync](https://docs.xbox.com/reference/live/xsapi-c/profile_c/functions/xblprofilegetuserprofileasync.md)
- [XblProfileGetUserProfilesAsync](https://docs.xbox.com/reference/live/xsapi-c/profile_c/functions/xblprofilegetuserprofilesasync.md)
