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

# WdCancellationHandle

> WdCancellationHandle

# WdCancellationHandle

用來取消進行中之複製作業的不透明控制代碼。

## 語法

```cpp theme={null}
typedef struct WdCancellationHandleImpl* WdCancellationHandle;
```

## 備註

`WdCancellationHandle` 是指向不透明內部結構的 typedef 指標。呼叫端負責管理控制代碼的生命週期：

1. 呼叫 [WdCreateCancellationHandle](/zh-TW/reference/remoting/functions/wdcreatecancellationhandle) 建立控制代碼。
2. 透過 `cancellationHandle` 參數將控制代碼傳遞給 [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy)。
3. 若要取消進行中的複製，請從另一個執行緒以該控制代碼呼叫 [WdCancelRemoteCopy](/zh-TW/reference/remoting/functions/wdcancelremotecopy)。
4. `WdRemoteCopy` 傳回之後，呼叫 [WdCloseCancellationHandle](/zh-TW/reference/remoting/functions/wdclosecancellationhandle) 關閉控制代碼。

可以使用 [WdDuplicateCancellationHandle](/zh-TW/reference/remoting/functions/wdduplicatecancellationhandle) 複製控制代碼。控制代碼的每個複本都必須以 `WdCloseCancellationHandle` 獨立關閉。

## 需求

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

## 另請參閱

* [WdCreateCancellationHandle](/zh-TW/reference/remoting/functions/wdcreatecancellationhandle)
* [WdCloseCancellationHandle](/zh-TW/reference/remoting/functions/wdclosecancellationhandle)
* [WdDuplicateCancellationHandle](/zh-TW/reference/remoting/functions/wdduplicatecancellationhandle)
* [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

- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
- [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle.md)
