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

Unregisters a previously registered user device association change callback.

## Syntax

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

### Parameters

*token*   \
Type: [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

The token that [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) 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).</Note>

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

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

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

## 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](/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](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserRegisterForDefaultAudioEndpointUtf16Changed](/reference/system/xuser/functions/xuserregisterfordefaultaudioendpointutf16changed.md)
- [XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [XUser](/reference/system/xuser/xuser_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
