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

# XSystemGetXboxLiveSandboxId

> XSystemGetXboxLiveSandboxId

# XSystemGetXboxLiveSandboxId

XBOX Live サンドボックス ID を取得します。

## Syntax

```cpp theme={null}
HRESULT XSystemGetXboxLiveSandboxId(  
         size_t sandboxIdSize,  
         char* sandboxId,  
         size_t* sandboxIdUsed  
)  
```

### Parameters

*sandboxIdSize*   \_In\_<br />型: size\_t

*sandboxId* のサイズ (バイト単位)。この値は XSystem.h で定義されている **XSystemXboxLiveSandboxIdMaxBytes** 定数以上である必要があります。

*sandboxId*   \_Out\_writes\_bytes\_to\_(sandboxIdSize,\*sandboxIdUsed)<br />型: char\*

サンドボックス ID を受け取る文字バッファー。

*sandboxIdUsed*   \_Out\_opt\_<br />型: size\_t\*

返される *sandboxId* バッファーの実際のサイズ (バイト単位)。

### Return value

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

成功した場合は **S\_OK**、それ以外の場合はエラー コードを返します。エラー コードの一覧については、[エラー コード](/reference/errorcodes) を参照してください。*sandboxIdSize* が **XSystemXboxLiveSandboxIdMaxBytes** より小さい値に設定されているために関数が失敗した場合、戻り値は **HRESULT\_FROM\_WIN32(ERROR\_INSUFFICIENT\_BUFFER)** に設定されます。

## Remarks

TitleID およびサービス構成 ID (SCID) と共に、サンドボックス ID は XBOX Live タイトルおよびアプリケーションの開発にとって重要です。サンドボックス ID はサンドボックスを識別し、開発中に開発キットのコンテンツを分離します。コンテンツの分離により、タイトルの開発およびテスト用のクリーンな環境が確保されます。

<Note>
  サンドボックス ID は大文字と小文字を区別します。
</Note>

XBOX デバイスと PC デバイスの場合、サンドボックス ID はデバイス上に保存されます。サンドボックス ID が見つからない場合や、サンドボックス ID にアクセスする権限がない場合、サンドボックス ID の既定値は 'RETAIL' になります。

ゲームが実際に小売環境で実行されている場合も、この関数は 'RETAIL' を返します。

## Requirements

**ヘッダー:** XSystem.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [タイム センシティブ スレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[開発キット設定の構成 (NDA トピック)](/home/setup-install/dev-kit-settings/config-dev-kit-settings)<br />[XBOX Live 開発用サンドボックスのセットアップ](/services/xbox-services/fundamentals/sandboxes/live-setting-up-sandboxes)<br />[XSystemGetConsoleId](/reference/system/xsystem/functions/xsystemgetconsoleid)<br />[XSystem](/reference/system/xsystem/xsystem_members)


## Related topics

- [コンソールの所在地の判定](/ja-jp/build/game-principles/localization/determining-console-geolocation.md)
- [XSystem](/ja-jp/reference/system/xsystem/xsystem_members.md)
- [XGameGetXboxTitleId](/ja-jp/reference/system/xgame/functions/xgamegetxboxtitleid.md)
- [PFAccountManagementGetPlayFabIDsFromXboxLiveIDsRequest](/ja-jp/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementgetplayfabidsfromxboxliveidsrequest.md)
- [XSystemGetConsoleId](/ja-jp/reference/system/xsystem/functions/xsystemgetconsoleid.md)
