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

# WdCreateCancellationHandle

> WdCreateCancellationHandle

# WdCreateCancellationHandle

[WdRemoteCopy](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdremotecopy.md) で開始されたコピー操作をキャンセルするために使用できるキャンセル ハンドルを作成します。

## 構文

```cpp theme={null}
HRESULT WdCreateCancellationHandle(  
         _Out_ WdCancellationHandle* cancellationHandle  
);  
```

### パラメーター

`_Out_ cancellationHandle`\
Type: **[WdCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/structs/wdcancellationhandle.md)\***

新しく作成されたキャンセル ハンドルを受け取ります。呼び出し元は、不要になったときに [WdCloseCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdclosecancellationhandle.md) を呼び出してこのハンドルを解放する必要があります。

### 戻り値

Type: **HRESULT**

成功した場合は `S_OK` を返します。それ以外の場合はエラー コードを返します。

## 解説

コピー操作を開始する前に `WdCreateCancellationHandle` を呼び出して、キャンセルを有効にするハンドルを取得します。`cancellationHandle` パラメーターを介して `WdRemoteCopy` にハンドルを渡し、次に別のスレッドから `WdCancelRemoteCopy` にそれを渡して操作をキャンセルします。

`WdRemoteCopy` が戻った後、[WdCloseCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdclosecancellationhandle.md) を呼び出してハンドルを閉じます。ハンドルは複数の `WdRemoteCopy` 呼び出しにわたって再利用できますが、各ハンドルは最終的に閉じる必要があります。

## 要件

| 要件 | 値 |
| - | - |
| **ヘッダー** | WdRemoteIteration.h |
| **ライブラリ** | wdremoteapi.lib |
| **サポートされている OS** | Windows 11 以降 |
| **サポートされているアーキテクチャ** | x64、ARM64 |

## 関連項目

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


## Related topics

- [WdCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/structs/wdcancellationhandle.md)
- [WdCloseCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdclosecancellationhandle.md)
- [WdDuplicateCancellationHandle](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdduplicatecancellationhandle.md)
- [WdCancelRemoteCopy](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdcancelremotecopy.md)
- [WdCancelRemoteDelete](https://docs.xbox.com/ja-jp/reference/remoting/functions/wdcancelremotedelete.md)
