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

# XGameGetXboxTitleId

> XGameGetXboxTitleId

# XGameGetXboxTitleId

게임의 TitleID를 반환합니다.

## 구문

```cpp theme={null}
HRESULT XGameGetXboxTitleId(  
         uint32_t* titleId  
)  
```

### 매개 변수

*titleId*   \_Out\_\
형식: uint32\_t\*

게임의 TitleID에 대한 포인터입니다.

### 반환 값

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

성공하면 **S\_OK**를 반환하고, 그렇지 않으면 오류 코드를 반환합니다. 오류 코드 목록은 [오류 코드](/reference/errorcodes)를 참조하세요. TitleID가 MicrosoftGame.config 파일에서 게임 개발자에 의해 구성되지 않은 경우 반환 값은 \*\*HRESULT\_FROM\_WIN32(ERROR\_NOT\_FOUND)\*\*로 설정됩니다.

## 설명

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

TitleID는 XBOX Live 서비스에 대해 게임을 고유하게 식별합니다. 이는 사용자 통계 및 실적과 같은 게임의 Live 콘텐츠에 사용자가 액세스할 수 있도록 하고 Live 멀티플레이어 기능을 활성화하기 위해 XBOX Live 서비스 전반에 걸쳐 사용됩니다. TitleID는 게임의 MicrosoftGame.config 매니페스트 파일에 저장됩니다.

다음 예제는 게임에서 사용되는 백엔드 REST 서비스를 호출하기 위한 URL을 생성합니다. **XGameGetXBoxTitleId** 함수를 호출하여 TitleID를 URL의 일부로 포함합니다.

```cpp theme={null}
std::string GetBackendServiceUrl()  
{  
    uint32_t titleId;  
  
    RetailAssert(SUCCEEDED(XGameGetXboxTitleId(&titleId)));  
  
    std::stringstream url;  
    url << "https://example.com/some/api/call";  
  
    url << std::hex << std::uppercase << std::setfill('0');  
    url << "/titleId/" << std::setw(8) << titleId;  
  
    return url.str();  
}   
```

## 요구 사항

**헤더:** XGame.h

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

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

## 개념 문서

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

## 함께 보기

[MicrosoftGame.config](/build/core-features/common/game-config/MicrosoftGameConfig-toc)\
[XGame](/reference/system/xgame/xgame_members)\
[XBOX Live 개발용 샌드박스 설정](/services/xbox-services/fundamentals/sandboxes/live-setting-up-sandboxes)
