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

> Sends a raw feature report to the device.

Sends a raw feature report to the device.

## Syntax

```cpp theme={null}
HRESULT SetRawDeviceFeature(
    IGameInputRawDeviceReport* report
);
```

### Parameters

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

The feature report to send. Create it by calling [CreateRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md) with `GameInputRawFeatureReport`, and fill it by calling [IGameInputRawDeviceReport::SetRawData](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_setrawdata.md).

### Return value

Type: HRESULT

Returns `S_OK` if the report was submitted to the device. Returns `GAMEINPUT_E_AGGREGATE_OPERATION_NOT_SUPPORTED` if the device is an aggregate device, or another error code if the report can't be submitted.

## Remarks

The `SetRawDeviceFeature` method writes a feature report to the device. The report ID is taken from the report's [GameInputRawDeviceReportInfo](https://docs.xbox.com/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md), and the payload is the data set with [IGameInputRawDeviceReport::SetRawData](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_setrawdata.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 and how large each one is. Feature reports are currently exposed for HID devices. For HID devices, the first byte of the report data is the report ID.

`SetRawDeviceFeature` queues the report for delivery and returns without waiting for the device to process it. A successful return value means the report was submitted, not that the device accepted it. To confirm the new state, read the report back by calling [GetRawDeviceFeature](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md).

```cpp theme={null}
Microsoft::WRL::ComPtr<IGameInputRawDeviceReport> report;
if (SUCCEEDED(device->CreateRawDeviceReport(reportId, GameInputRawFeatureReport, &report)))
{
    // The first byte of a HID feature report is the report ID.
    uint8_t data[] = { static_cast<uint8_t>(reportId), 0x01, 0x00 };
    if (report->SetRawData(sizeof(data), data))
    {
        device->SetRawDeviceFeature(report.Get());
    }
}
```

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)\
[GetRawDeviceFeature](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.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)\
[CreateRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md)\
[IGameInputRawDeviceReport](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.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::SetRawDeviceFeature (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md).


## Related topics

- [IGameInputDevice::SetRawDeviceFeature (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.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::GetRawDeviceFeature](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md)
- [IGameInputDevice (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
