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

# XInputGetCapabilities

> XInputGetCapabilities

# XInputGetCapabilities

接続されているコントローラーの機能とフィーチャーを取得します。

<a id="syntaxSection" />

## 構文

```cpp theme={null}
DWORD XInputGetCapabilities(  
         DWORD dwUserIndex,  
         DWORD dwFlags,  
         XINPUT_CAPABILITIES * pCapabilities  
)  
```

<a id="parametersSection" />

### パラメーター

*dwUserIndex*   \_In\_\
型: DWORD

デバイスに関連付けられているゲーマーのインデックス。0 ～ `XUSER_MAX_COUNT - 1` の範囲の値。

*dwFlags*   \_In\_\
型: DWORD

コントローラーの種類を識別する入力フラグ。この値が 0 の場合、システムに接続されているすべてのコントローラーの機能が返されます。現在サポートされているのは `XINPUT_FLAG_GAMEPAD` のみです。

*pCapabilities*   \_Out\_\
型: [XINPUT\_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities)\*

コントローラーの機能を受け取る [XINPUT\_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities) オブジェクトへのポインター。

<a id="retvalSection" />

### 戻り値

型: DWORD

関数が成功した場合、戻り値は `ERROR_SUCCESS` です。

コントローラーが接続されていない場合、戻り値は `ERROR_DEVICE_NOT_CONNECTED` です。

関数が失敗した場合、戻り値は WinError.h で定義されているエラー コードです。この関数は、呼び出し元のスレッドのラスト エラー コードを設定するために `SetLastError` を使用しません。

<a id="remarksSection" />

## 解説

<Note>従来の XINPUT 9.1.0 バージョン (Windows Vista 以降に含まれる) は、接続されているデバイスに関係なく常に固定の機能セットを返していました。</Note>

報告される機能の詳細については、[XINPUT\_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities) を参照してください。

詳細については、[XInputOnGameInput ラッパー](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection)を参照してください。

<a id="requirementsSection" />

## 要件

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

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

**対応プラットフォーム:** XBOX One ファミリー本体および XBOX Series 本体

<a id="seealsoSection" />

## 関連項目

[XInput から GameInput への移植](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_CAPABILITIES](/ja-jp/reference/input/xinputongameinput/structs/xinput_capabilities.md)
- [XInputOnGameInput](/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)
- [GameInputDeviceCapabilities](/ja-jp/reference/input/gameinput/deprecated/enums/gameinputdevicecapabilities.md)
- [Dynamic Latency Input](/ja-jp/build/core-features/common/input/advanced/input-synchronization.md)
- [GetDeviceInfo](/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)
