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

# WdEnumDevices

> WdEnumDevices

Enumerates a filtered snapshot of saved devices.

**Introduced in:** [RIT 0.0.14-preview](https://docs.xbox.com/reference/remoting/release-versions.md#release-versions).

## Syntax

```cpp theme={null}
HRESULT WD_REMOTE_ITERATION_CALL WdEnumDevices(
    _In_opt_z_ const char* remoteDeviceSubstring,
    _Out_ uint32_t* deviceCount,
    _In_ WdDeviceInfoCallback callback,
    _In_opt_ void* context
);
```

### Parameters

`remoteDeviceSubstring`\
Type: **const char\***

Optional substring filter for saved device names. Pass `nullptr` or an empty string for all records.

`deviceCount`\
Type: **uint32\_t\***

Required output receiving the number of matching saved records in the snapshot.

`callback`\
Type: **WdDeviceInfoCallback**

The required result or enumeration callback. See Remarks for continuation and lifetime rules.

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

Optional caller-owned context passed unchanged to the callback.

### Return value

Type: **HRESULT**

Returns `S_OK` on success; otherwise returns a failure HRESULT. Catalog operations also return catalog-specific errors described in [Error codes](https://docs.xbox.com/reference/remoting/error-codes.md).

## Remarks

A null or empty substring selects every record. Matching folds ASCII letters; non-ASCII UTF-8 bytes compare unchanged. Wildcards aren't supported.

`deviceCount` receives the number of matching records in the snapshot, not the number of callbacks completed before an early stop. No callback is invoked for an empty result. A failed callback result stops enumeration and is returned.

Saved-device APIs and pairing-ID APIs change different local stores. They don't replace the explicit `remoteDevice` argument of a remote API call; callers that want default selection must resolve it themselves.

## Requirements

| Requirement | Value |
| - | - |
| **Header** | WdRemoteIteration.h |
| **Library** | wdremoteapi.lib |
| **NuGet Package** | [Microsoft.GDK.RemoteIterationClientApi](https://aka.ms/GameDevRemoteAPI) |

## See also

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


## Related topics

- [XBOX PC Remote Iteration API](https://docs.xbox.com/reference/remoting/remoteiteration_members.md)
- [WdEnumDeviceIds](https://docs.xbox.com/reference/remoting/functions/wdenumdeviceids.md)
- [WdEnumDeviceNamespaces](https://docs.xbox.com/reference/remoting/functions/wdenumdevicenamespaces.md)
- [WdEnumDeviceProperties](https://docs.xbox.com/reference/remoting/functions/wdenumdeviceproperties.md)
- [WdEnumRemoteDirectory](https://docs.xbox.com/reference/remoting/functions/wdenumremotedirectory.md)
