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

# IGameInputRawDeviceReport::SetRawData

> IGameInputRawDeviceReport::SetRawData

# IGameInputRawDeviceReport::SetRawData

設定報告緩衝區的內容。

## 語法

```cpp theme={null}
bool SetRawData(
    size_t bufferSize,
    const void* buffer
)
```

### 參數

*bufferSize*   \_In\_<br />
類型：size\_t

要設定的原始資料緩衝區大小。

*buffer*   \_In\_reads\_(bufferSize)<br />
類型：void\*

要寫入的緩衝區。

### 傳回值

類型：bool

成功時傳回 true；否則傳回 false。

## 備註

`IGameInputRawDeviceReport::SetRawData` 方法可讓應用程式直接設定報告緩衝區內容。呼叫端必須傳遞大小與 [GetRawDataSize](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getrawdatasize) 方法傳回值相符的來源緩衝區。只有輸出報告允許設定報告緩衝區內容。

## 需求

**標頭：** GameInput.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

[進階 GameInput 主題](/zh-TW/build/core-features/common/input/advanced/input-advanced-topics)\
[GameInput 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)\
[IGameInputRawDeviceReport](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v3** | 重新推出。 |
| **v1** | 隨 IGameInputRawDeviceReport 介面一併移除。 |
| **v0** | 推出。 |


## Related topics

- [IGameInputRawDeviceReport](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)
- [IGameInputRawDeviceReport::GetRawData](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getrawdata.md)
- [IGameInputRawDeviceReport::GetRawDataSize](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getrawdatasize.md)
- [IGameInputDevice::SetRawDeviceFeature](/zh-TW/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)
- [IGameInputRawDeviceReport::GetDevice](/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getdevice.md)
