> ## 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](/zh-TW/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

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

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

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

[XUserRegisterForDeviceAssociationChanged](/zh-TW/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)

[XUserRegisterForDefaultAudioEndpointUtf16Changed](/zh-TW/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed)

[XUserUnregisterForDefaultAudioEndpointUtf16Changed](/zh-TW/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed)


## Related topics

- [XUserUnregisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md)
- [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
