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

# GetDeviceInfo

> GetDeviceInfo

# GetDeviceInfo

入力デバイスの完全なプロパティおよび機能に関する静的情報にアクセスします。

## 構文

```cpp theme={null}
HRESULT GetDeviceInfo(
    const GameInputDeviceInfo** info
);
```

### パラメーター

*info*   \_Outptr\_\
型: GameInputDeviceInfo\*\*

IGameInputDevice に関連付けられているデバイス情報です。

### 戻り値

型: HRESULT

関数の結果です。

## 解説

`GetDeviceInfo` メソッドで返されるメモリはアプリケーションが所有するものではありません。アプリケーションが `IGameInput` インスタンスを存続させている間は、このメモリにアクセスできます。`IGameInput` オブジェクトへの参照が解放されると、そのメモリは破棄されます。

次のコード例は、レーシング ホイールにクラッチがあるかどうかを判定する方法を示しています。

```cpp theme={null}
bool HasClutch(IGameInputDevice* wheel) noexcept
{
    const GameInputDeviceInfo* wheelInfo = nullptr;
    const bool succeeded = wheel->GetDeviceInfo(&wheelInfo);
    assert(succeeded);
    assert(wheelInfo->racingWheelInfo);

    const bool hasClutch = wheelInfo->racingWheelInfo->hasClutch;

    return hasClutch;
}
```

## 要件

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

[GameInput の概要](/build/core-features/common/input/overviews/input-overview)\
[GameInputDeviceInfo](/reference/input/gameinput/structs/gameinputdeviceinfo)\
[IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## バージョン履歴

| バージョン  | 変更点                                                                                                                                                                                                                                                                                                           |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **v3** | シグネチャは変更なし。[GameInputDeviceInfo](/reference/input/gameinput/structs/gameinputdeviceinfo) を拡張: `controllerInfo` を追加 (個別の axis/button/switch の count+info フィールドおよび `uiNavigationInfo` を置き換え)、`inputReportCount`/`inputReportInfo` および `outputReportCount`/`outputReportInfo` を追加、`hapticFeedbackMotorInfo` を削除。 |
| **v2** | シグネチャは変更なし。[GameInputDeviceInfo](/reference/input/gameinput/structs/gameinputdeviceinfo) に `revisionNumber`、`hardwareVersion`、`firmwareVersion`、`containerId`、`sensorsInfo` を追加して拡張。                                                                                                                          |
| **v1** | シグネチャは変更なし。[GameInputDeviceInfo](/reference/input/gameinput/structs/gameinputdeviceinfo) を大幅に簡素化: `infoSize`、`interfaceNumber`、`collectionNumber`、`capabilities`、touch/haptic/string/descriptor 各フィールドを削除、`supportedSystemButtons`、`displayName`、`pnpPath` を追加。                                               |
| **v0** | 導入。                                                                                                                                                                                                                                                                                                           |


## Related topics

- [GameInputDeviceFamily](/ja-jp/reference/input/gameinput/enums/gameinputdevicefamily.md)
- [GameInput のフォースフィードバック](/ja-jp/build/core-features/common/input/advanced/input-forcefeedback.md)
- [ユーザーと入力デバイス](/ja-jp/build/core-features/common/user/users-input-devices.md)
- [GameInput API のバージョン管理](/ja-jp/build/core-features/common/input/overviews/input-versioning.md)
- [player_device_info](/ja-jp/services/playfab/api-references/events/PlayerIdentity/player-device-info.md)
