> ## 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.

# XblContextGetXboxUserId

> XblContextGetXboxUserId

# XblContextGetXboxUserId

获取与上下文关联的用户的 XBOX 用户 ID。

## 语法

```cpp theme={null}
HRESULT XblContextGetXboxUserId(  
         XblContextHandle context,  
         uint64_t* xboxUserId  
)  
```

### 参数

*context*   \_In\_\
类型：[XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

XBOX Live 上下文句柄。

*xboxUserId*   \_Out\_\
类型：uint64\_t\*

回传 XBOX 用户 ID。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 要求

**头文件：** xbox\_live\_context\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

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


## Related topics

- [XblContextGetUser](/zh-CN/reference/live/xsapi-c/xbox_live_context_c/functions/xblcontextgetuser.md)
- [PartyXblChatUser::GetXboxUserId](/zh-CN/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getxboxuserid.md)
- [PartyXblChatUser::GetCustomContext](/zh-CN/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_getcustomcontext.md)
- [PartyXblManager::GetEntityIdsFromXboxLiveUserIds](/zh-CN/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getentityidsfromxboxliveuserids.md)
- [PartyXblGetEntityIdsFromXboxLiveUserIdsCompletedStateChange](/zh-CN/services/playfab/multiplayer/networking/xblreference/structs/partyxblgetentityidsfromxboxliveuseridscompletedstatechange.md)
