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

# WdGetDefaultDevice

> WdGetDefaultDevice

保存済みの既定のデバイスが選択されている場合は、そのデバイスを返します。

**導入バージョン:** [RIT 0.0.14-preview](https://docs.xbox.com/ja-jp/reference/remoting/release-versions.md#release-versions)。

## 構文

```cpp theme={null}
HRESULT WD_REMOTE_ITERATION_CALL WdGetDefaultDevice(
    _Out_ bool* deviceFound,
    _In_ WdDeviceInfoResultCallback callback,
    _In_opt_ void* context
);
```

### パラメーター

`deviceFound`\
Type: **bool\***

既定のデバイスが選択されているかどうかを示す必須の出力。

`callback`\
Type: **WdDeviceInfoResultCallback**

必須の結果コールバックまたは列挙コールバック。継続と有効期間の規則については、「解説」を参照してください。

`context`\
Type: **void\***

省略可能。コールバックにそのまま渡される、呼び出し元が所有するコンテキスト。

### 戻り値

Type: **HRESULT**

成功した場合は `S_OK` を返します。それ以外の場合は、エラーを示す HRESULT を返します。カタログ操作では、「[XBOX PC Remote Iteration API エラー コード](https://docs.xbox.com/ja-jp/reference/remoting/error-codes.md)」で説明されているカタログ固有のエラーも返されます。

## 解説

`deviceFound` とコールバックの両方が必須です。既定のデバイスがない場合、呼び出しは成功し、`deviceFound` を `false` に設定し、コールバックは呼び出しません。既定のデバイスがある場合、コールバックはそのレコードを受け取ります。このローカル クエリでは、接続性や承認は確認されません。

保存済みデバイスの API とペアリング ID の API は、それぞれ異なるローカル ストアを変更します。これらの API は、リモート API 呼び出しの明示的な `remoteDevice` 引数に代わるものではありません。既定のデバイスを選択したい呼び出し元は、自分で解決する必要があります。

## 要件

| 要件 | 値 |
| - | - |
| **ヘッダー** | WdRemoteIteration.h |
| **ライブラリ** | wdremoteapi.lib |
| **NuGet パッケージ** | [Microsoft.GDK.RemoteIterationClientApi](https://aka.ms/GameDevRemoteAPI) |

## 関連項目

* [XBOX PC Remote Iteration API](https://docs.xbox.com/ja-jp/reference/remoting/remoteiteration_members.md)


## Related topics

- [XBOX PC Remote Iteration API](https://docs.xbox.com/ja-jp/reference/remoting/remoteiteration_members.md)
- [WdSetDefaultDevice](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdsetdefaultdevice.md)
- [WdGetDevice](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdgetdevice.md)
- [WdGetDeviceProperty](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdgetdeviceproperty.md)
- [WdGetDeviceStoragePath](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdgetdevicestoragepath.md)
