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

# WdCancelRemoteCopy

> WdCancelRemoteCopy

# WdCancelRemoteCopy

Cancels an in-progress copy operation.

## Syntax

```cpp theme={null}
HRESULT WdCancelRemoteCopy(  
         _In_ WdCancellationHandle cancellationHandle  
);  
```

### Parameters

`_In_ cancellationHandle`\
Type: **[WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)**

The cancellation handle created by [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle) and passed to [WdRemoteCopy](/reference/remoting/functions/wdremotecopy). Signaling this handle causes the in-progress copy to be cancelled.

### Return value

Type: **HRESULT**

Returns `S_OK` if successful; otherwise, returns an error code.

## Remarks

Call `WdCancelRemoteCopy` from a separate thread to cancel a blocking [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) call. `WdCancelRemoteCopy` is a non-blocking function. After cancellation is signaled, `WdRemoteCopy` will cancel the copy and return `S_OK`.

## Requirements

| Requirement                 | Value                |
| --------------------------- | -------------------- |
| **Header**                  | WdRemoteIteration.h  |
| **Library**                 | wdremoteapi.lib      |
| **Supported OS**            | Windows 11 and later |
| **Supported architectures** | x64, ARM64           |

## See also

* [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)
* [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)
* [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle)
* [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle)
* [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members)


## Related topics

- [WdRemoteCopy](/reference/remoting/functions/wdremotecopy.md)
- [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members.md)
- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
- [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle.md)
- [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle.md)
