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

> デバイスが定義する生の機能レポートの説明を取得します。

デバイスが定義する生の機能レポートの説明を取得します。

## 構文

```cpp theme={null}
uint32_t GetFeatureReportInfo(
    uint32_t infoArrayCount,
    GameInputRawDeviceReportInfo* infoArray
);
```

### パラメーター

*infoArrayCount*   \_In\_\
型: uint32\_t

*infoArray* の要素数。すべての機能レポートを取得するには、[GetFeatureReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md) から返された値を渡します。

*infoArray*   \_Out\_writes\_to\_opt\_(infoArrayCount, return)\
型: [GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)\*

機能レポートごとに 1 つの構造体を受け取る配列へのポインター。`nullptr` を指定できます。その場合、何も書き込まれず、メソッドは 0 を返します。

### 戻り値

型: uint32\_t

*infoArray* に書き込まれた要素の数。これは *infoArrayCount* とデバイス上の機能レポートの数のうち小さい方の値です。*infoArray* が `nullptr` の場合、またはデバイスに機能レポートがない場合は 0 です。

## 解説

各要素は [GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md) 構造体です。その `kind` メンバーは `GameInputRawFeatureReport`、`id` メンバーはデバイスが定義するレポート ID、`size` メンバーはレポート データのサイズ (バイト単位) です。

[GetFeatureReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md) を呼び出して機能レポートの数を取得し、そのサイズの配列を割り当ててから、`GetFeatureReportInfo` を呼び出して配列にデータを格納します。*infoArrayCount* が機能レポートの数より小さい場合は、先頭から *infoArrayCount* 個の要素のみが書き込まれます。デバイスが接続されている間、デバイスの機能レポートは変化しないため、一度クエリを実行して結果をキャッシュできます。

要素の `id` メンバーを [GetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md) の *reportId* パラメーターとして使用するとレポートを読み取ることができます。また、`GameInputRawFeatureReport` と共に [CreateRawDeviceReport](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md) の *reportId* パラメーターとして使用すると、[SetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md) で送信できるレポートを作成できます。`size` メンバーは、レポート データのバイト数を示します。

次の例は、デバイスの機能レポートを取得する方法を示しています。

```cpp theme={null}
uint32_t reportCount = device->GetFeatureReportCount();
std::vector<GameInputRawDeviceReportInfo> reports(reportCount);
reports.resize(device->GetFeatureReportInfo(reportCount, reports.data()));

for (const GameInputRawDeviceReportInfo& report : reports)
{
    Microsoft::WRL::ComPtr<IGameInputRawDeviceReport> feature;
    if (SUCCEEDED(device->GetRawDeviceFeature(report.id, &feature)))
    {
        // Read the report data with GetRawDataSize and GetRawData.
    }
}
```

## 要件

**ヘッダー:** GameInput.h

**ライブラリ:** gameinput.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 関連項目

[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[GetFeatureReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md)\
[GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)\
[GameInputRawDeviceReportKind](https://docs.xbox.com/ja-jp/reference/input/gameinput/enums/gameinputrawdevicereportkind.md)\
[IGameInputRawDeviceReport](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)\
[GetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md)\
[SetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)\
[CreateRawDeviceReport](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md)\
[GameInput の高度なトピック](https://docs.xbox.com/ja-jp/build/core-features/common/input/advanced/input-advanced-topics.md)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 導入されました。 |


## Related topics

- [GameInputRawDeviceReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)
- [IGameInputDevice::GetFeatureReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportcount.md)
- [IGameInputDevice::GetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md)
- [IGameInputDevice::SetRawDeviceFeature](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)
- [IGameInputDevice::GetInputReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md)
