> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminginitialize.md) を呼び出してください。 |
| E\_NOT\_SUFFICIENT\_BUFFER | 0x7A | clientCount で指定された数が、現在接続されているクライアント数より小さいです。 |

エラー コードの一覧については、[Error Codes](https://docs.xbox.com/ja-jp/reference/errorcodes.md) を参照してください。

## Remarks

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

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

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

## Requirements

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

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

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

## See also

[XGameStreamingIsStreaming](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreamingisstreaming.md)\
[XGameStreamingRegisterConnectionStateChanged](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)\
[XGameStreamingGetClientCount](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetclientcount.md)\
[XGameStreaming](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)


## Related topics

- [XGameStreamingGetClientCount](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetclientcount.md)
- [XGameStreamingGetConnectionState](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetconnectionstate.md)
- [XBOX Game Streaming の開発のベスト プラクティス](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreaming (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingClientProperty](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
