> ## 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](/zh-TW/reference/remoting/structs/wdcancellationhandle)。

## 語法

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

### 參數

`_In_ cancellationHandle`\
類型：**[WdCancellationHandle](/zh-TW/reference/remoting/structs/wdcancellationhandle)**

要複製的取消控制代碼。

`_Out_ duplicatedHandle`\
類型：**[WdCancellationHandle](/zh-TW/reference/remoting/structs/wdcancellationhandle)\***

接收複製的取消控制代碼。呼叫端負責呼叫 [WdCloseCancellationHandle](/zh-TW/reference/remoting/functions/wdclosecancellationhandle) 來獨立關閉此控制代碼。

### 傳回值

類型：**HRESULT**

如果成功，則傳回 `S_OK`；否則傳回錯誤碼。

## 備註

當多個元件需要參考相同的取消控制代碼時，請使用 `WdDuplicateCancellationHandle`。原始控制代碼與複製的控制代碼都參考相同的取消狀態：在任一控制代碼上透過 [WdCancelRemoteCopy](/zh-TW/reference/remoting/functions/wdcancelremotecopy) 發出取消訊號，都會取消相關聯的 [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy) 作業。每個控制代碼都必須以 [WdCloseCancellationHandle](/zh-TW/reference/remoting/functions/wdclosecancellationhandle) 獨立關閉。

## 需求

| 需求 | 值 |
| - | - |
| **標頭** | WdRemoteIteration.h |
| **程式庫** | wdremoteapi.lib |
| **支援的作業系統** | Windows 11 及更新版本 |
| **支援的架構** | x64, ARM64 |

## 另請參閱

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


## Related topics

- [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle.md)
- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
- [WdCloseCancellationHandle](/ko/reference/remoting/functions/wdclosecancellationhandle.md)
- [WdCreateCancellationHandle](/ko/reference/remoting/functions/wdcreatecancellationhandle.md)
