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

# XUserFindForDevice

> XUserFindForDevice

# XUserFindForDevice

특정 장치 ID에 대한 사용자 ID를 가져옵니다.

## 구문

```cpp theme={null}
HRESULT XUserFindForDevice(  
         const APP_LOCAL_DEVICE_ID* deviceId,  
         XUserHandle* handle  
)  
```

### 매개변수

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

장치의 ID입니다.\
*handle*   \_Out\_\
형식: XUserHandle\*

로컬 사용자의 XUID를 포함합니다.

### 반환값

형식: HRESULT

성공하면 S\_OK를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.
오류 코드 목록은 [Error Codes](/reference/errorcodes)를 참조하십시오.

## 설명

<Note>이 함수는 시간에 민감한 스레드에서 호출하기에 안전하지 않습니다. 자세한 내용은 [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)를 참조하십시오.</Note>

사용자와 장치 간의 연결은 다음과 같은 여러 이유로 변경될 수 있습니다.

* 사용자가 콘솔에서 로그아웃하는 경우.
* 누군가 입력 장치를 사용하여 계정 선택 도구에서 다른 사용자를 선택하는 경우.

사용자-장치 연결이 변경될 때 알림을 받으려면 [XUserRegisterForDeviceAssociationChanged](/reference/system/xuser/functions/xuserregisterfordeviceassociationchanged)를 호출하여 [XUserDeviceAssociationChangedCallback](/reference/system/xuser/functions/xuserdeviceassociationchangedcallback)을 가져옵니다.

<Note>*XUserFindForDevice*는 [XUserAddAsync](/reference/system/xuser/functions/xuseraddasync) 호출로 로그인하지 않은 사용자에 대해서는 사용자 핸들을 반환할 수 없습니다. 자세한 내용은 [사용자 및 입력 장치](/build/core-features/common/user/users-input-devices)를 참조하십시오.</Note>

## 요구 사항

**헤더:** 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](/reference/system/xuser/xuser_members)

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

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


## Related topics

- [XUserFindUserById](/ko/reference/system/xuser/functions/xuserfinduserbyid.md)
- [XUserFindUserByLocalId](/ko/reference/system/xuser/functions/xuserfinduserbylocalid.md)
- [APP_LOCAL_DEVICE_ID](/ko/reference/system/xuser/structs/app_local_device_id.md)
- [XUser](/ko/reference/system/xuser/xuser_members.md)
- [사용자 및 입력 장치](/ko/build/core-features/common/user/users-input-devices.md)
