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

# WdCancelRemoteCopy

> WdCancelRemoteCopy

Cancels an in-progress copy operation.

## Syntax

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

### Parameters

`_In_ cancellationHandle`\
Type: **[WdCancellationHandle](https://docs.xbox.com/reference/remoting/structs/wdcancellationhandle.md)**

The cancellation handlecreated by [WdCreateCancellationHandle](https://docs.xbox.com/reference/remoting/functions/wdcreatecancellationhandle.md) and passed to [WdRemoteCopy](https://docs.xbox.com/reference/remoting/functions/wdremotecopy.md). 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](https://docs.xbox.com/reference/remoting/functions/wdremotecopy.md) call. `WdCancelRemoteCopy` is a non-blocking function that signals cancellation; `WdRemoteCopy` may return `S_OK` or a failure.

Because `WdRemoteCopy` may return either result after cancellation is observed, the return value alone doesn't indicate whether the operation was cancelled or ran to completion. Track cancellation state in your own code if you need to distinguish the two — for example, to suppress an error message or skip a retry after a user-initiated cancel.

## Requirements

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

## See also

* [WdRemoteCopy](https://docs.xbox.com/reference/remoting/functions/wdremotecopy.md)
* [WdCancellationHandle](https://docs.xbox.com/reference/remoting/structs/wdcancellationhandle.md)
* [WdCreateCancellationHandle](https://docs.xbox.com/reference/remoting/functions/wdcreatecancellationhandle.md)
* [WdCloseCancellationHandle](https://docs.xbox.com/reference/remoting/functions/wdclosecancellationhandle.md)
* [XBOX PC Remote Iteration API](https://docs.xbox.com/reference/remoting/remoteiteration_members.md)


## Related topics

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