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

# XGameStreamingGetClients

> XGameStreamingGetClients

# XGameStreamingGetClients

現在接続されている各クライアントの ID を取得します。

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetClients(  
         uint32_t clientCount,  
         XGameStreamingClientId* clients,  
         uint32_t* clientsUsed  
)  
```

### Parameters

*clientCount*   \_In\_\
型: uint32\_t

clients 配列に返すクライアントの最大数。

*clients*   \_Out\_writes\_to\_(clientCount,*clientsUsed)\
型: XGameStreamingClientId*

接続されているクライアント ID を格納するバッファー。

*clientsUsed*   \_Out\_\
型: uint32\_t\*

clients 配列に実際に書き込まれたクライアントの数。

### Return value

型: HRESULT

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

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

| エラー コード                            | エラー値       | エラーの理由                                                                                                                                                     |
| ---------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming ランタイムが初期化されていません。他の API を呼び出す前に [XGameStreamingInitialize](/reference/system/xgamestreaming/functions/xgamestreaminginitialize) を呼び出してください。 |
| E\_NOT\_SUFFICIENT\_BUFFER         | 0x7A       | clientCount で指定された数が、現在接続されているクライアント数より小さいです。                                                                                                              |

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

## Remarks

現在接続されているすべてのストリーミング クライアント デバイスの `XGameStreamingClientId` を取得するために使用します。

いずれかのデバイスが接続されストリーミング中であるかどうかだけを確認したい場合は、[XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming) の使用を検討してください。

ストリーミング クライアントの接続や切断時に通知を受け取る必要がある場合は、[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged) の使用を検討してください。

## Requirements

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

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

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

## See also

[XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming)\
[XGameStreamingRegisterConnectionStateChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)\
[XGameStreamingGetClientCount](/reference/system/xgamestreaming/functions/xgamestreaminggetclientcount)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

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