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

# XGameStreamingGetServerLocationName

> XGameStreamingGetServerLocationName

# XGameStreamingGetServerLocationName

ストリーミング サーバーのデータ センターの場所の名前を取得します。

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetServerLocationName(
         size_t serverLocationNameSize,
         char* serverLocationName
)
```

<a id="parametersSection" />

### Parameters

*serverLocationNameSize*   \_In\_\
型: size\_t

返すデータ センターの場所名の最大サイズ。
`serverLocationNameSize` は [XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize) を呼び出して取得してください。

*serverLocationName*   \_Out\_writes\_z\_(serverLocationNameSize)\
型: char\*

ストリーミング XBOX サーバーをホストするデータ センターがある Azure リージョンの名前。

<a id="retvalSection" />

### Return value

型: HRESULT

成功した場合は **S\_OK** を返します。それ以外の場合はエラー コードを返します。

**想定されるエラー**

| エラー コード                            | エラー値       | エラーの理由                                                                                                                                                     |
| ---------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming ランタイムが初期化されていません。他の API を呼び出す前に [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) を呼び出してください。 |
| E\_NOT\_SUFFICIENT\_BUFFER         | 0x7A       | *serverLocationSize* が、サーバー ロケーションの完全な名前 (および終端の null 文字) を格納するのに十分な大きさではありません。                                                                            |
| E\_GAMESTREAMING\_NO\_DATACENTER   | 0x89245403 | 現在のマシンはデータ センターで動作していません。                                                                                                                                  |

エラー コードの一覧については、[Error Codes](/reference/errorcodes) を参照してください。

<a id="remarksSection" />

## Remarks

この関数を呼び出す前に、[XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize) を呼び出してサーバー ロケーション名のサイズを取得し、バッファーを割り当てることができます。

ゲームが Azure PlayFab Multiplayer Servers でホストされているゲーム サーバーに接続する場合や、ゲーム サーバーとのレイテンシを最小限に抑えたい場合に、Azure リージョンを活用できます。

`E_GAMESTREAMING_NO_DATACENTER` エラーは、プレイヤーがコンソール ストリーミングを使用して自宅の XBOX からゲームをストリーミングしているときに発生することがあります。このエラーは、XBOX Developer Kit でオーバーライド値が設定されていない場合にも発生することがあります。

XBOX Developer Kit では、テスト中に返される `serverLocationName` を **Developer Home** の **Streaming** タブで設定できます。

<a id="requirementsSection" />

## Requirements

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

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

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

<a id="seealsoSection" />

## See also

[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)\
[XGameStreamingGetServerLocationNameSize](/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize)


## Related topics

- [XGameStreamingGetServerLocationNameSize](/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetserverlocationnamesize.md)
- [XGameStreaming](/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XBOX Game Streaming 向けにゲームを最適化する](/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameStreamingGetTouchBundleVersionNameSize](/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggettouchbundleversionnamesize.md)
