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

# XUserUnregisterForDeviceAssociationChanged

> XUserUnregisterForDeviceAssociationChanged

# XUserUnregisterForDeviceAssociationChanged

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

## 语法

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

### 参数

*token*   \
类型：[XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

在注册回调时 [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) 返回的令牌。

*wait*   \
类型：bool

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

### 返回值

类型：bool

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

## 备注

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

要为用户设备关联更改事件注册回调，请调用 [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)。

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

要注销之前注册的默认音频终结点更改回调，请调用 [XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed)。

## 要求

**头文件：** 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](/reference/system/xuser/xuser_members)

[XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)

[XUserRegisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed)

[XUserUnregisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed)


## Related topics

- [XUserRegisterForDeviceAssociationChanged](/zh-CN/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](/zh-CN/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](/zh-CN/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [XUser](/zh-CN/reference/system/xuser/xuser_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
