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

# XInputGetStateWithToken

> XInputGetStateWithToken

# XInputGetStateWithToken

Recupera o estado atual do controle especificado e o associa a um token de pipeline de quadros D3DX.

<a id="syntaxSection" />

## Sintaxe

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

<a id="parametersSection" />

### Parâmetros

*dwUserIndex*   \_In\_\
Tipo: DWORD

Índice do jogador associado ao dispositivo; um valor no intervalo de 0 a `XUSER_MAX_COUNT - 1`.

*framePipelineToken*   \_In\_\
Tipo: UINT64

Token de pipeline de quadros D3DX.

*pState*   \_Out\_\
Tipo: [XINPUT\_STATE](/pt-BR/reference/input/xinputongameinput/structs/xinput_state)\*

Ponteiro para um objeto [XINPUT\_STATE](/pt-BR/reference/input/xinputongameinput/structs/xinput_state) que recebe o estado atual do controle.

<a id="retvalSection" />

### Valor retornado

Tipo: DWORD

Se a função for bem-sucedida, ela retornará `ERROR_SUCCESS`.

Se o controle não estiver conectado, a função retornará `ERROR_DEVICE_NOT_CONNECTED`.

Se a função falhar, ela retornará um código de erro definido em WinError.h.

<a id="remarksSection" />

## Comentários

Essa função é semelhante a [XInputGetState](/pt-BR/reference/input/xinputongameinput/functions/xinputgetstate), mas associa uma leitura de entrada específica a um quadro gráfico para análise posterior.

<Note>A partir da versão May Preview, o comportamento de `XInputGetStateWithToken` é idêntico ao de `XInputGetState`, pois o código subjacente do GameInput não está totalmente implementado.</Note>

Ao fornecer o token de pipeline de quadros, você pode posteriormente correlacionar as chamadas de API de entrada com quadros gráficos específicos no software PIX.

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** XInputOnGameInput.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[Portabilidade do XInput para o GameInput](/pt-BR/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/pt-BR/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputGetStateWithToken](/reference/input/xinputongameinput/functions/xinputgetstatewithtoken.md)
- [XInputGetState](/reference/input/xinputongameinput/functions/xinputgetstate.md)
- [XINPUT_STATE](/reference/input/xinputongameinput/structs/xinput_state.md)
- [Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput.md)
