> ## 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-TW/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

註冊回呼時，[XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-TW/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-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)。

若要註冊由應用程式定義、並在預設音訊端點變更時叫用的回呼，請呼叫 [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)。

若要取消註冊先前已註冊的預設音訊端點變更回呼，請呼叫 [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-TW/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-TW/reference/system/xuser/xuser_members.md)

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

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

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


## Related topics

- [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/zh-TW/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](https://docs.xbox.com/zh-TW/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [XUser (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xuser/xuser_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
