> ## 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-TW/reference/remoting/structs/wdcancellationhandle.md)。

## 語法

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

### 參數

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

要複製的取消控制代碼。

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

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

### 傳回值

類型：**HRESULT**

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

## 備註

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

## 需求

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

## 另請參閱

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


## Related topics

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