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

# IGameInputDevice::GetRawDeviceFeature

> Reads a raw feature report from the device.

Reads a raw feature report from the device.

## Syntax

```cpp theme={null}
HRESULT GetRawDeviceFeature(
    uint32_t reportId,
    IGameInputRawDeviceReport** report
);
```

### Parameters

*reportId*   \_In\_\
Type: uint32\_t

ID of the feature report to read. Must match the `id` member of one of the reports returned by [GetFeatureReportInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md).

*report*   \_COM\_Outptr\_\
Type: [IGameInputRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)\*\*

Receives a new `IGameInputRawDeviceReport` object that contains the feature report data read from the device. Set to `nullptr` on failure.

### Return value

Type: HRESULT

Returns `S_OK` on success. Returns `E_NOTFOUND` if the device doesn't define a feature report with the specified ID, and `GAMEINPUT_E_AGGREGATE_OPERATION_NOT_SUPPORTED` if the device is an aggregate device. Returns other error codes if the report can't be read from the device.

## Remarks

The `GetRawDeviceFeature` method requests the current contents of a feature report from the device and returns them in a new [IGameInputRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md) object. The `kind` member of the report's [GameInputRawDeviceReportInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md) is `GameInputRawFeatureReport`, and its data size matches the `size` member of the corresponding element returned by [GetFeatureReportInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md). Read the data by calling [GetRawDataSize](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getrawdatasize.md) and [IGameInputRawDeviceReport::GetRawData](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getrawdata.md).

Use [GetFeatureReportCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md) and [GetFeatureReportInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md) to discover which feature reports a device defines. Feature reports are currently exposed for HID devices. For HID devices, the first byte of the report data is the report ID.

Unlike the other raw report methods, `GetRawDeviceFeature` waits for the device to reply before it returns, so avoid calling it on time-critical threads such as your render or input-polling thread.

```cpp theme={null}
Microsoft::WRL::ComPtr<IGameInputRawDeviceReport> report;
if (SUCCEEDED(device->GetRawDeviceFeature(reportId, &report)))
{
    std::vector<uint8_t> data(report->GetRawDataSize());
    data.resize(report->GetRawData(data.size(), data.data()));
    // Parse the device-specific feature report data...
}
```

For intermediate and advanced use cases of the GameInput API, see [Advanced GameInput topics](https://docs.xbox.com/build/core-features/common/input/advanced/input-advanced-topics.md).

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

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

## See also

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[SetRawDeviceFeature](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)\
[GetFeatureReportCount](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md)\
[GetFeatureReportInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md)\
[IGameInputRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)\
[CreateRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md)\
[IGameInputDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## Version History

| Version | Changes |
| - | - |
| **v4** | Re-introduced. |
| **v1** | Removed. |
| **v0** | Introduced (not implemented). |

## Appendix: Previous versions

### v0

In GameInput v0, this method was declared with the same signature but wasn't implemented. For more information, see [IGameInputDevice::GetRawDeviceFeature (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md).


## Related topics

- [IGameInputDevice::GetRawDeviceFeature (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md)
- [GameInputRawDeviceReportKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputrawdevicereportkind.md)
- [GameInput API members](https://docs.xbox.com/reference/input/gameinput/gameinput_members.md)
- [IGameInputDevice::SetRawDeviceFeature](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)
- [IGameInputDevice::GetFeatureReportInfo](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md)
