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

# WdCreateCancellationHandle

> WdCreateCancellationHandle

# WdCreateCancellationHandle

Crée un handle d'annulation qui peut être utilisé pour annuler une opération de copie démarrée par [WdRemoteCopy](/fr-CA/reference/remoting/functions/wdremotecopy).

## Syntaxe

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

### Paramètres

`_Out_ cancellationHandle`\
Type : **[WdCancellationHandle](/fr-CA/reference/remoting/structs/wdcancellationhandle)\***

Reçoit le handle d'annulation nouvellement créé. L'appelant est responsable de libérer ce handle en appelant [WdCloseCancellationHandle](/fr-CA/reference/remoting/functions/wdclosecancellationhandle) lorsqu'il n'est plus nécessaire.

### Valeur de retour

Type : **HRESULT**

Retourne `S_OK` en cas de réussite; sinon, retourne un code d'erreur.

## Remarques

Appelez `WdCreateCancellationHandle` avant de démarrer une opération de copie afin d'obtenir un handle permettant l'annulation. Passez le handle à [WdRemoteCopy](/fr-CA/reference/remoting/functions/wdremotecopy) au moyen du paramètre `cancellationHandle`, puis passez-le à [WdCancelRemoteCopy](/fr-CA/reference/remoting/functions/wdcancelremotecopy) à partir d'un thread distinct pour annuler l'opération.

Après le retour de `WdRemoteCopy`, fermez le handle en appelant [WdCloseCancellationHandle](/fr-CA/reference/remoting/functions/wdclosecancellationhandle). Le handle peut être réutilisé pour plusieurs appels à `WdRemoteCopy`, mais chaque handle doit finir par être fermé.

## Configuration requise

| Exigence | Valeur |
| - | - |
| **En-tête** | WdRemoteIteration.h |
| **Bibliothèque** | wdremoteapi.lib |
| **SE pris en charge** | Windows 11 et versions ultérieures |
| **Architectures prises en charge** | x64, ARM64 |

## Voir aussi

* [WdCloseCancellationHandle](/fr-CA/reference/remoting/functions/wdclosecancellationhandle)
* [WdDuplicateCancellationHandle](/fr-CA/reference/remoting/functions/wdduplicatecancellationhandle)
* [WdCancellationHandle](/fr-CA/reference/remoting/structs/wdcancellationhandle)
* [WdRemoteCopy](/fr-CA/reference/remoting/functions/wdremotecopy)
* [WdCancelRemoteCopy](/fr-CA/reference/remoting/functions/wdcancelremotecopy)
* [API d'itération à distance XBOX PC](/fr-CA/reference/remoting/remoteiteration_members)


## Related topics

- [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle.md)
- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
