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

# WdCancelRemoteDirectoryEnumeration

> WdCancelRemoteDirectoryEnumeration

Signals cancellation of a remote directory enumeration.

**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 WdCancelRemoteDirectoryEnumeration(
    _In_ WdCancellationHandle cancellationHandle
);
```

### Parameters

`cancellationHandle`\
Type: **WdCancellationHandle**

A cancellation handle created with `WdCreateCancellationHandle`. Where optional, pass `nullptr` if cancellation isn't needed.

### Return value

Type: **HRESULT**

Returns `S_OK` on success; otherwise returns a failure HRESULT. See [Error codes](https://docs.xbox.com/reference/remoting/error-codes.md).

## Remarks

Pass the handle used by `WdEnumRemoteDirectory`. This call signals cancellation without blocking. Wait for the enumeration call to return before closing the handle. Cancellation doesn't invalidate entries already delivered.

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

- [WdEnumRemoteDirectory](https://docs.xbox.com/reference/remoting/functions/wdenumremotedirectory.md)
- [XBOX PC Remote Iteration API](https://docs.xbox.com/reference/remoting/remoteiteration_members.md)
- [WdCancellationHandle](https://docs.xbox.com/reference/remoting/structs/wdcancellationhandle.md)
- [WdRemoteDirectoryOptions](https://docs.xbox.com/reference/remoting/structs/wdremotedirectoryoptions.md)
- [WdRemoteDirectoryEntryType](https://docs.xbox.com/reference/remoting/enums/wdremotedirectoryentrytype.md)
