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

# WdDuplicateCancellationHandle

> WdDuplicateCancellationHandle

Duplicates an existing [WdCancellationHandle](https://docs.xbox.com/reference/remoting/structs/wdcancellationhandle.md).

## Syntax

```cpp theme={null}
HRESULT WdDuplicateCancellationHandle(  
         _In_ WdCancellationHandle cancellationHandle,  
         _Out_ WdCancellationHandle* duplicatedHandle  
);  
```

### Parameters

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

The cancellation handle to duplicate.

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

Receives the duplicated cancellation handle. The caller is responsible for closing this handle independently by calling [WdCloseCancellationHandle](https://docs.xbox.com/reference/remoting/functions/wdclosecancellationhandle.md).

### Return value

Type: **HRESULT**

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

## Remarks

Use `WdDuplicateCancellationHandle` when multiple components need to reference the same cancellation handle. Both the original and duplicated handles refer to the same cancellation state — signaling cancellation via [WdCancelRemoteCopy](https://docs.xbox.com/reference/remoting/functions/wdcancelremotecopy.md) on either handle cancels the associated [WdRemoteCopy](https://docs.xbox.com/reference/remoting/functions/wdremotecopy.md) operation. Each handle must be closed independently with [WdCloseCancellationHandle](https://docs.xbox.com/reference/remoting/functions/wdclosecancellationhandle.md).

## Requirements

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

## See also

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


## Related topics

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