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

# XInputGetStateWithToken

> XInputGetStateWithToken

# XInputGetStateWithToken

指定されたコントローラーの現在の状態を取得し、D3DX フレーム パイプライン トークンに関連付けます。

## 構文

```cpp theme={null}
DWORD XInputGetStateWithToken(  
         DWORD dwUserIndex,  
         UINT64 framePipelineToken,  
         XINPUT_STATE * pState  
)  
```

### パラメーター

*dwUserIndex*   \_In\_\
型: DWORD

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

*framePipelineToken*   \_In\_\
型: UINT64

D3DX フレーム パイプライン トークン。

*pState*   \_Out\_\
型: [XINPUT\_STATE](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/structs/xinput_state.md)\*

コントローラーの現在の状態を受け取る [XINPUT\_STATE](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/structs/xinput_state.md) オブジェクトへのポインター。

### 戻り値

型: DWORD

関数が成功した場合、`ERROR_SUCCESS` を返します。

コントローラーが接続されていない場合、関数は `ERROR_DEVICE_NOT_CONNECTED` を返します。

関数が失敗した場合は、WinError.h で定義されているエラー コードを返します。

## 解説

この関数は [XInputGetState](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/functions/xinputgetstate.md) と似ていますが、特定の入力読み取りをグラフィックス フレームに関連付けて後で分析できるようにします。

> [!NOTE]
>
> 5 月のプレビュー リリース時点では、基になる GameInput コードが完全には実装されていないため、`XInputGetStateWithToken` の動作は `XInputGetState` と同一です。

フレーム パイプライン トークンを指定することで、後で PIX ソフトウェアの特定のグラフィックス フレームと入力 API 呼び出しを関連付けることができます。

## 要件

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

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

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

## 関連項目

[XInput から GameInput への移植](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

- [XINPUT_STATE](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/structs/xinput_state.md)
- [XInputGetState](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/functions/xinputgetstate.md)
- [XInput から GameInput への移植](https://docs.xbox.com/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md)
- [XInputOnGameInput (API の内容)](https://docs.xbox.com/ja-jp/reference/input/xinputongameinput/xinputongameinput_members.md)
- [GetKeyState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md)
