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

# XUserDeviceAssociationChange

> XUserDeviceAssociationChange

# XUserDeviceAssociationChange

디바이스 연결이 변경될 때 이전 디바이스 연결과 새 디바이스 연결을 지정합니다.

## 구문

```cpp theme={null}
typedef struct XUserDeviceAssociationChange {  
    APP_LOCAL_DEVICE_ID deviceId;  
    XUserLocalId oldUser;  
    XUserLocalId newUser;  
} XUserDeviceAssociationChange  
```

### 멤버

*deviceId*\
형식: [APP\_LOCAL\_DEVICE\_ID](/reference/system/xuser/structs/app_local_device_id)

사용자 연결이 변경되는 디바이스의 ID입니다.

*oldUser*\
형식: [XUserLocalId](/reference/system/xuser/structs/xuserlocalid)

디바이스와 연결된 이전 사용자 ID입니다.

*newUser*\
형식: [XUserLocalId](/reference/system/xuser/structs/xuserlocalid)

디바이스와 연결된 새 사용자 ID입니다.

## 설명

XUserDeviceAssociationChange에 대한 모든 인수는 "null"일 수 있습니다.

* deviceId가 **XUserNullDeviceId**와 같은 경우 사용자 변경은 로그인된 사용자와 연결된 모든 디바이스에 적용됩니다.
* oldUser가 **XUserNullUserLocalId**와 같은 경우 디바이스와 사용자 간의 연결이 새로 생성된 것입니다.
* newUser가 **XUserNullUserLocalId**와 같은 경우 기존 디바이스와 사용자 간의 연결이 손실된 것입니다.

<Note>*newUser*는 [XUserAddAsync](/reference/system/xuser/functions/xuseraddasync) 호출을 통해 이미 타이틀에 추가된 사용자만 참조할 수 있습니다. 시스템 선택기를 사용하여 타이틀이 알지 못하는 사용자에게 입력 디바이스를 페어링한 경우, newUser는 **XUserNullUserLocalId**와 같게 됩니다. 자세한 내용은 [Users and input devices](/build/core-features/common/user/users-input-devices)를 참조하십시오.</Note>

이러한 멤버는 memcmp 또는 동등한 방법을 사용하여 비교할 수 있는 원시 바이트 구조로 처리해야 합니다. 예를 들면 다음과 같습니다.

```cpp theme={null}
XUserDeviceAssociationChange *change; // incoming argument from callback

if(memcmp(&change->deviceId, &XUserNullDeviceId, sizeof(APP_LOCAL_DEVICE_ID) == 0))
{
}

if(memcmp(&change->newUser, &XUserNullUserLocalId, sizeof(XUserLocalId) == 0))
{
}
```

[XUserDeviceAssociationChangedCallback](/reference/system/xuser/functions/xuserdeviceassociationchangedcallback) 콜백 함수는 XUserDeviceAssociationChange 구조체에 대한 포인터를 사용합니다.

콜백 함수는 콜백이 등록될 때 [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) 함수에 컨텍스트를 전달합니다.

[XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged) 함수는 사용자 디바이스 연결 변경 이벤트에 대한 콜백을 등록합니다.

## 요구 사항

**헤더:** XUser.h

**지원되는 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XUser](/reference/system/xuser/xuser_members)

[XUserDeviceAssociationChangedCallback](/reference/system/xuser/functions/xuserdeviceassociationchangedcallback)

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


## Related topics

- [XUserDeviceAssociationChangedCallback](/ko/reference/system/xuser/functions/xuserdeviceassociationchangedcallback.md)
- [APP_LOCAL_DEVICE_ID](/ko/reference/system/xuser/structs/app_local_device_id.md)
- [XUser](/ko/reference/system/xuser/xuser_members.md)
- [XUserRegisterForDeviceAssociationChanged](/ko/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged.md)
- [XUserUnregisterForDeviceAssociationChanged](/ko/reference/system/xuser/functions/xuserunregisterfordeviceassociationchanged.md)
