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

# WdDuplicateCancellationHandle

> WdDuplicateCancellationHandle

# WdDuplicateCancellationHandle

Duplicates an existing [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle).

## Syntax

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

### Parameters

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

The cancellation handle to duplicate.

`_Out_ duplicatedHandle`\
Type: **[WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)\***

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

### 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](/reference/remoting/functions/wdcancelremotecopy) on either handle cancels the associated [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) operation. Each handle must be closed independently with [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle).

## Requirements

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

## See also

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


## Related topics

- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
- [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle.md)
- [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle.md)
- [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members.md)
- [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy.md)
