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

# XInputGetCapabilities

> XInputGetCapabilities

Retrieves the capabilities and features of a connected controller.

## Syntax

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

### 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](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_capabilities.md)\*

Pointer to an [XINPUT\_CAPABILITIES](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_capabilities.md) object that receives the controller capabilities.

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

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

For details about reported capabilities, see [XINPUT\_CAPABILITIES](https://docs.xbox.com/reference/input/xinputongameinput/structs/xinput_capabilities.md).

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

## Requirements

**Header:** XInputOnGameInput.h

**Library:** xgameruntime.lib

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

## See also

[Porting from XInput to GameInput](https://docs.xbox.com/build/core-features/common/input/porting/input-porting-xinput.md)\
[XInputOnGameInput](https://docs.xbox.com/reference/input/xinputongameinput/xinputongameinput_members.md)


## Related topics

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