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

Unregisters a previously registered user device association change callback.

## Syntax

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

### Parameters

*token*   \
Type: [XTaskQueueRegistrationToken](https://docs.xbox.com/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

The token that [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md) returns when registering the callback.

*wait*   \
Type: bool

Specify **true** to wait until the callback unregisters; **false** to immediately return.

### Return value

Type: bool

Returns **true** if the callback successfully unregisters; **false** otherwise.

## Remarks

> [!NOTE]
>
> This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

To register a callback for user device association change events, call [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md).

To register a callback that an application defines and invokes when the default audio endpoint is changes, call [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md).

To unregister a previously-registered default audio endpoint change callback, call [XUserUnregisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/reference/system/xuser/functions/xuserunregisterfordefaultaudioendpointutf16changed.md).

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

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

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

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

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


## Related topics

- [XUserRegisterForDeviceAssociationChanged](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](https://docs.xbox.com/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](https://docs.xbox.com/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [XUser (API contents)](https://docs.xbox.com/reference/system/xuser/xuser_members.md)
- [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)
