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

# chat_user::custom_user_context

> chat_user::custom_user_context

# chat\_user::custom\_user\_context

检索先前与此用户关联的应用的可选、私有、自定义指针大小的上下文值。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
void* custom_user_context(  
)  
```

<a id="parametersSection" />

### 参数

无。

<a id="retvalSection" />

### 返回值

类型：void\*

先前与此用户关联的指针大小的值；否则为空指针。

<a id="remarksSection" />

## 备注

此方法检索先前与此 [chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user) 对象关联的应用的私有、自定义指针大小的上下文值。如果尚未为此 `chat_user` 对象设置自定义用户上下文，则此方法返回空指针。

自定义用户上下文通常用作“快捷方式”，可简化对与用户关联的本地、应用特定内存的访问，而无需进行映射查找。使用 [chat\_user::set\_custom\_user\_context](/reference/chat/gamechat2/classes/chat_user/methods/chat_user_set_custom_user_context) 方法为 `chat_user` 对象设置自定义用户上下文。

<a id="requirementsSection" />

## 要求

**头文件：** GameChat2.h

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

<a id="seealsoSection" />

## 另请参阅

[Game Chat 2 简介](/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)\
[chat\_user](/reference/chat/gamechat2/classes/chat_user/chat_user)


## Related topics

- [chat_user::set_custom_user_context](/zh-CN/reference/chat/gamechat2/classes/chat_user/methods/chat_user_set_custom_user_context.md)
- [chat_user::xbox_user_id](/zh-CN/reference/chat/gamechat2/classes/chat_user/methods/chat_user_xbox_user_id.md)
- [chat_user::chat_indicator](/zh-CN/reference/chat/gamechat2/classes/chat_user/methods/chat_user_chat_indicator.md)
- [chat_user::local](/zh-CN/reference/chat/gamechat2/classes/chat_user/methods/chat_user_local_function_2.md)
- [chat_user_local::remote_user_muted](/zh-CN/reference/chat/gamechat2/classes/chat_user/chat_user_local/methods/chat_user_local_remote_user_muted.md)
