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

# XSystemGetConsoleId

> XSystemGetConsoleId

# XSystemGetConsoleId

현재 디바이스의 콘솔 ID를 반환합니다.

## 구문

```cpp theme={null}
HRESULT XSystemGetConsoleId(  
         size_t consoleIdSize,  
         char* consoleId,  
         size_t* consoleIdUsed  
)  
```

### 매개 변수

*consoleIdSize*   \_In\_\
형식: size\_t

*consoleId*의 크기(바이트)입니다. 이 값은 XSystem.h에 정의된 **XSystemConsoleIdBytes** 상수보다 크거나 같아야 합니다.

*consoleId*   \_Out\_writes\_bytes\_to\_(consoleIdSize,\*consoleIdUsed)\
형식: char\*

콘솔 ID를 받을 문자 버퍼입니다.

*consoleIdUsed*   \_Out\_opt\_\
형식: size\_t\*

반환되는 *consoleId* 버퍼의 크기(바이트)입니다.

### 반환 값

형식: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

성공하면 **S\_OK**를 반환하고, 그렇지 않으면 오류 코드를 반환합니다. 오류 코드 목록은 [오류 코드](/reference/errorcodes)를 참조하세요. *consoleIdSize*가 **XSystemConsoleIdBytes**보다 작은 값으로 설정되어 함수가 실패하는 경우, 반환 값은 \*\*HRESULT\_FROM\_WIN32(ERROR\_INSUFFICIENT\_BUFFER)\*\*로 설정됩니다.

## 설명

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

콘솔 ID는 개발 시나리오에서만 XBOX Live용 XBOX 디바이스를 고유하게 식별합니다. 콘솔 ID는 로깅 및 관리 목적으로 콘솔을 식별하는 데 사용됩니다. 예를 들어 분석 정보를 캡처하거나, 개발 환경에서 재부팅할 개발 키트를 결정하는 데 사용됩니다. 이 함수가 반환하는 ID는 설정 \ 시스템 \ 콘솔 정보에서 볼 수 있는 콘솔 ID와 일치합니다.

XBOX 디바이스의 경우 콘솔 ID가 디바이스에 저장되어 있습니다. 콘솔 ID를 찾을 수 없거나 콘솔 ID에 액세스할 권한이 없는 경우 콘솔 ID는 기본적으로 `00000000.00000000.00000000.00000000.00`으로 지정됩니다. PC 디바이스의 경우 콘솔 ID는 항상 기본적으로 `00000000.00000000.00000000.00000000.00`으로 지정됩니다.

RETAIL에서는 이 함수가 항상 `00000000.00000000.00000000.00000000.00`을 반환합니다. 게임에서 소매를 포함한 모든 상황에서 사용할 수 있는
식별자가 필요한 경우 두 가지 옵션이 있습니다.

* 애플리케이션이 SSO(Single-Sign-On)를 사용하는 경우 이 함수가 반환하는 ID 대신 XSTS SSO 토큰의 pairwise ID를 사용해야 합니다.
* 그렇지 않으면 [XSystemGetAppSpecificDeviceId](/reference/system/xsystem/functions/xsystemgetappspecificdeviceid) 함수를 사용하세요.

## 요구 사항

**헤더:** XSystem.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 개념 문서

* [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 함께 보기

[개발 키트 활성화(NDA 주제)](/home/setup-install/devkits/setup/activating-dev-kit)\
[XSystemGetXboxLiveSandbodId](/reference/system/xsystem/functions/xsystemgetxboxlivesandboxid)\
[XSystem](/reference/system/xsystem/xsystem_members)


## Related topics

- [XSystemGetXboxLiveSandboxId](/ko/reference/system/xsystem/functions/xsystemgetxboxlivesandboxid.md)
- [XSystem](/ko/reference/system/xsystem/xsystem_members.md)
- [IXtfConsoleControlClient::GetSystemTime](/ko/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getsystemtime.md)
- [XSystemGetAppSpecificDeviceId](/ko/reference/system/xsystem/functions/xsystemgetappspecificdeviceid.md)
- [XtfGetConsoleFieldValue](/ko/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
