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

> 入力デバイスのベンダー ID を取得します。

入力デバイスのベンダー ID を取得します。

## 構文

```cpp theme={null}
uint16_t GetVendorId();
```

### パラメーター

このメソッドにはパラメーターがありません。

### 戻り値

型: uint16\_t

入力デバイスの製造元を識別するベンダー ID。デバイスがベンダー ID を報告しない場合は 0。

## 解説

ベンダー ID は、[IGameInputDevice::GetProductId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getproductid.md) から返される製品 ID と組み合わせて、特定のデバイス モデルを識別します。USB デバイスと Bluetooth デバイスの場合、これらは通常、デバイスがオペレーティング システムに報告するベンダー ID および製品 ID と同じです。同じ製品のハードウェア リビジョンを区別するには、[IGameInputDevice::GetRevisionNumber](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrevisionnumber.md) を使用します。

ベンダー ID は、デバイス オブジェクトの有効期間中は変化しません。

次の例では、デバイスが特定のベンダー ID と製品 ID に一致するかどうかを確認します。

```cpp theme={null}
bool IsDeviceModel(
    IGameInputDevice* device,
    uint16_t vendorId,
    uint16_t productId) noexcept
{
    return device->GetVendorId() == vendorId &&
           device->GetProductId() == productId;
}
```

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) 構造体の `vendorId` メンバーから取得できました。

## 要件

**ヘッダー:** 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)\
[IGameInputDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::GetProductId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getproductid.md)\
[IGameInputDevice::GetRevisionNumber](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrevisionnumber.md)

## バージョン履歴

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


## Related topics

- [IGameInputDevice::GetProductId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getproductid.md)
- [IGameInputDevice::GetRevisionNumber](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getrevisionnumber.md)
- [IGameInputDevice::GetDeviceId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceid.md)
- [IGameInputDevice::GetDeviceRootId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicerootid.md)
- [IGameInputDevice::GetContainerId](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontainerid.md)
