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

# XInputSetState

> XInputSetState

# XInputSetState

Envia dados de vibração para o controle de dois motores especificado.

<a id="syntaxSection" />

## Sintaxe

```cpp theme={null}
DWORD XInputSetState(  
         DWORD dwUserIndex,  
         const XINPUT_VIBRATION * pVibration  
)  
```

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

*pVibration*   \_In\_\
Tipo: [XINPUT\_VIBRATION](/pt-BR/reference/input/xinputongameinput/structs/xinput_vibration)\*

Ponteiro para um objeto [XINPUT\_VIBRATION](/pt-BR/reference/input/xinputongameinput/structs/xinput_vibration) que contém as informações de vibração a serem enviadas ao 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 dá suporte a controles mais antigos que têm apenas dois motores de feedback tátil. Para dar suporte a motores de feedback adicionais em controles mais recentes, chame [XInputSetStateEx](/pt-BR/reference/input/xinputongameinput/functions/xinputsetstateex).

Para obter mais informações, consulte [O wrapper XInputOnGameInput](/pt-BR/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<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

- [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate.md)
- [XInputSetStateEx](/reference/input/xinputongameinput/functions/xinputsetstateex.md)
