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

Retrieves the capabilities and features of a connected controller.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*dwUserIndex*   \_In\_\
Type: DWORD

Index of the gamer associated with the device; a value in the range of 0 to `XUSER_MAX_COUNT - 1`.

*dwFlags*   \_In\_\
Type: DWORD

Input flags that identify the controller type. If this value is 0, the capabilities of all controllers connected to the system are returned. Currently, only `XINPUT_FLAG_GAMEPAD` is supported.

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

Pointer to an [XINPUT\_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities) object that receives the controller capabilities.

<a id="retvalSection" />

### Return value

Type: DWORD

If the function succeeds, the return value is `ERROR_SUCCESS`.

If the controller is not connected, the return value is `ERROR_DEVICE_NOT_CONNECTED`.

If the function fails, the return value is an error code defined in WinError.h. The function does not use `SetLastError` to set the calling thread's last-error code.

<a id="remarksSection" />

## Remarks

<Note>The legacy XINPUT 9.1.0 version (included in Windows Vista and later) always returned a fixed set of capabilities regardless of attached device.</Note>

For details about reported capabilities, see [XINPUT\_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities).

For more information, see [The XInputOnGameInput wrapper](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<a id="requirementsSection" />

## Requirements

**Header:** XInputOnGameInput.h

**Library:** xgameruntime.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Porting from XInput to GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_CAPABILITIES](/reference/input/xinputongameinput/structs/xinput_capabilities.md)
- [XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members.md)
- [Technical capabilities](/publishing/game-publishing/concepts/properties-technical-capabilities.md)
- [GameInputDeviceCapabilities](/reference/input/gameinput/deprecated/enums/gameinputdevicecapabilities.md)
- [GetDeviceInfo](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)
