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

# XUserUnregisterForDeviceAssociationChanged

> XUserUnregisterForDeviceAssociationChanged

# XUserUnregisterForDeviceAssociationChanged

注销之前注册的用户设备关联更改回调。

## 语法

```cpp theme={null}
bool XUserUnregisterForDeviceAssociationChanged(  
         XTaskQueueRegistrationToken token,  
         bool wait  
)  
```

### 参数

*token*   \
类型：[XTaskQueueRegistrationToken](https://docs.xbox.com/zh-CN/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

在注册回调时 [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md) 返回的令牌。

*wait*   \
类型：bool

指定为 **true** 以等待直到回调注销；指定为 **false** 以立即返回。

### 返回值

类型：bool

如果回调成功注销，则返回 **true**；否则返回 **false**。

## 备注

> [!NOTE]
>
> 此函数不适合在时间敏感线程上调用。有关详细信息，请参阅[时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。

要为用户设备关联更改事件注册回调，请调用 [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)。

要注册一个由应用程序定义并在默认音频终结点更改时调用的回调，请调用 [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)。

要注销之前注册的默认音频终结点更改回调，请调用 [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)。

## 要求

**头文件：** XUser.h

**库：** xgameruntime.lib

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

## 概念文档

* [时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

[XUser](https://docs.xbox.com/zh-CN/reference/system/xuser/xuser_members.md)

[XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)

[XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)

[XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md)


## Related topics

- [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-CN/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](https://docs.xbox.com/zh-CN/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [XUser（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xuser/xuser_members.md)
- [在 Unity 项目中使用 GDK API 的 C# 包装器](https://docs.xbox.com/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
