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

Crea un identificador de cancelación que se puede usar para cancelar una operación de copia iniciada por [WdRemoteCopy](/reference/remoting/functions/wdremotecopy).

## Sintaxis

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

### Parámetros

`_Out_ cancellationHandle`\
Tipo: **[WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)\***

Recibe el identificador de cancelación recién creado. El autor de la llamada es responsable de liberar este identificador llamando a [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle) cuando ya no sea necesario.

### Valor devuelto

Tipo: **HRESULT**

Devuelve `S_OK` si se realiza correctamente; de lo contrario, devuelve un código de error.

## Comentarios

Llame a `WdCreateCancellationHandle` antes de iniciar una operación de copia para obtener un identificador que permita la cancelación. Pase el identificador a [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) mediante el parámetro `cancellationHandle` y, a continuación, páselo a [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy) desde un subproceso independiente para cancelar la operación.

Cuando `WdRemoteCopy` devuelva un valor, cierre el identificador llamando a [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle). El identificador se puede reutilizar en varias llamadas a `WdRemoteCopy`, pero cada identificador debe cerrarse en algún momento.

## Requisitos

| Requisito                           | Valor                              |
| ----------------------------------- | ---------------------------------- |
| **Encabezado**                      | WdRemoteIteration.h                |
| **Biblioteca**                      | wdremoteapi.lib                    |
| **Sistemas operativos compatibles** | Windows 11 y versiones posteriores |
| **Arquitecturas compatibles**       | x64, ARM64                         |

## Consulte también

* [WdCloseCancellationHandle](/reference/remoting/functions/wdclosecancellationhandle)
* [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle)
* [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle)
* [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)
* [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy)
* [API XBOX PC Remote Iteration](/reference/remoting/remoteiteration_members)


## Related topics

- [WdCancellationHandle](/es/reference/remoting/structs/wdcancellationhandle.md)
- [WdCloseCancellationHandle](/es/reference/remoting/functions/wdclosecancellationhandle.md)
- [WdDuplicateCancellationHandle](/es/reference/remoting/functions/wdduplicatecancellationhandle.md)
- [WdCancelRemoteCopy](/es/reference/remoting/functions/wdcancelremotecopy.md)
- [WdRemoteCopy](/es/reference/remoting/functions/wdremotecopy.md)
