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

# WdDuplicateCancellationHandle

复制现有的 [WdCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/structs/wdcancellationhandle.md)。

## 语法

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

### 参数

`_In_ cancellationHandle`\
类型：**[WdCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/structs/wdcancellationhandle.md)**

要复制的取消句柄。

`_Out_ duplicatedHandle`\
类型：**[WdCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/structs/wdcancellationhandle.md)\***

接收复制得到的取消句柄。调用方负责通过调用 [WdCloseCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdclosecancellationhandle.md) 独立关闭该句柄。

### 返回值

类型：**HRESULT**

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

## 备注

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

## 要求

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

## 另请参阅

* [WdCreateCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcreatecancellationhandle.md)
* [WdCloseCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdclosecancellationhandle.md)
* [WdCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/structs/wdcancellationhandle.md)
* [WdRemoteCopy](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdremotecopy.md)
* [WdCancelRemoteCopy](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcancelremotecopy.md)
* [XBOX PC 远程迭代 API](https://docs.xbox.com/zh-CN/reference/remoting/remoteiteration_members.md)


## Related topics

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