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

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

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

## 構文

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

### パラメーター

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

*infoArray* の要素数。すべての出力レポートを取得するには、[GetOutputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportcount.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` メンバーは `GameInputRawOutputReport`、`id` メンバーはデバイスが定義するレポート ID、`size` メンバーはレポート データのサイズ (バイト単位) です。

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

要素の `id` メンバーを `GameInputRawOutputReport` と共に [CreateRawDeviceReport](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md) の *reportId* パラメーターとして使用すると、[SendRawDeviceOutput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_sendrawdeviceoutput.md) で送信できる出力レポートを作成できます。`size` メンバーは、デバイスが想定するレポート データのバイト数を示します。

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

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

for (const GameInputRawDeviceReportInfo& report : reports)
{
    Microsoft::WRL::ComPtr<IGameInputRawDeviceReport> output;
    if (SUCCEEDED(device->CreateRawDeviceReport(report.id, GameInputRawOutputReport, &output)))
    {
        // Fill the report with SetRawData, then send it with SendRawDeviceOutput.
    }
}
```

GameInput v3 以前では、この情報は [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) から返される [GameInputDeviceInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 構造体の `outputReportInfo` メンバーから取得できました。

## 要件

**ヘッダー:** 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)\
[GetOutputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportcount.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)\
[CreateRawDeviceReport](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createrawdevicereport.md)\
[SendRawDeviceOutput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_sendrawdeviceoutput.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::GetOutputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportcount.md)
- [IGameInputDevice::GetInputReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportinfo.md)
- [IGameInputDevice::GetFeatureReportInfo](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md)
- [IGameInputDevice::GetInputReportCount](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md)
