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

# WdCancellationHandle

> WdCancellationHandle

# WdCancellationHandle

用于取消正在进行的复制操作的不透明句柄。

## 语法

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

## 备注

`WdCancellationHandle` 是指向一个不透明内部结构的 typedef 指针。调用方负责管理句柄的生命周期：

1. 通过调用 [WdCreateCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcreatecancellationhandle.md) 创建句柄。
2. 通过 `cancellationHandle` 参数将该句柄传递给 [WdRemoteCopy](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdremotecopy.md)。
3. 要取消正在进行的复制，请从单独的线程使用该句柄调用 [WdCancelRemoteCopy](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcancelremotecopy.md)。
4. 在 `WdRemoteCopy` 返回后，通过调用 [WdCloseCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdclosecancellationhandle.md) 关闭该句柄。

可以使用 [WdDuplicateCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdduplicatecancellationhandle.md) 复制句柄。句柄的每一份副本都必须使用 `WdCloseCancellationHandle` 独立关闭。

## 要求

| 要求 | 值 |
| - | - |
| **头文件** | 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)
* [WdDuplicateCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdduplicatecancellationhandle.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

- [WdDuplicateCancellationHandle](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdduplicatecancellationhandle.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)
- [WdCancelRemoteCopy](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcancelremotecopy.md)
- [WdCancelRemoteDelete](https://docs.xbox.com/zh-CN/reference/remoting/functions/wdcancelremotedelete.md)
