> ## 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](/reference/remoting/functions/wdcreatecancellationhandle) 创建句柄。
2. 通过 `cancellationHandle` 参数将该句柄传递给 [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)。
3. 要取消正在进行的复制，请从单独的线程使用该句柄调用 [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy)。
4. 在 `WdRemoteCopy` 返回后，通过调用 [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle) 关闭该句柄。

可以使用 [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle) 复制句柄。句柄的每一份副本都必须使用 `WdCloseCancellationHandle` 独立关闭。

## 要求

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

## 另请参阅

* [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle)
* [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle)
* [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle)
* [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)
* [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy)
* [XBOX PC 远程迭代 API](/reference/remoting/remoteiteration_members)


## Related topics

- [WdDuplicateCancellationHandle](/zh-CN/reference/remoting/functions/wdduplicatecancellationhandle.md)
- [WdCloseCancellationHandle](/zh-CN/reference/remoting/functions/wdclosecancellationhandle.md)
- [WdCreateCancellationHandle](/zh-CN/reference/remoting/functions/wdcreatecancellationhandle.md)
- [WdCancelRemoteCopy](/zh-CN/reference/remoting/functions/wdcancelremotecopy.md)
- [WdRemoteCopy](/zh-CN/reference/remoting/functions/wdremotecopy.md)
