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

复制现有的 [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)。

## 语法

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

### 参数

`_In_ cancellationHandle`\
类型：**[WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)**

要复制的取消句柄。

`_Out_ duplicatedHandle`\
类型：**[WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)\***

接收复制得到的取消句柄。调用方负责通过调用 [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle) 独立关闭该句柄。

### 返回值

类型：**HRESULT**

如果成功，则返回 `S_OK`；否则，返回错误代码。

## 备注

当多个组件需要引用同一取消句柄时，请使用 `WdDuplicateCancellationHandle`。原始句柄和复制的句柄都引用相同的取消状态——通过在任一句柄上调用 [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy) 发出取消信号，都会取消关联的 [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) 操作。每个句柄都必须使用 [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle) 独立关闭。

## 要求

| 要求          | 值                   |
| ----------- | ------------------- |
| **头文件**     | WdRemoteIteration.h |
| **库**       | wdremoteapi.lib     |
| **支持的操作系统** | Windows 11 及更高版本    |
| **支持的体系结构** | x64、ARM64           |

## 另请参阅

* [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 远程迭代 API](/reference/remoting/remoteiteration_members)


## Related topics

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