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

Cria um identificador de cancelamento que pode ser usado para cancelar uma operação de cópia iniciada por [WdRemoteCopy](/pt-BR/reference/remoting/functions/wdremotecopy).

## Sintaxe

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

### Parâmetros

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

Recebe o identificador de cancelamento recém-criado. O chamador é responsável por liberar esse identificador chamando [WdCloseCancellationHandle](/pt-BR/reference/remoting/functions/wdclosecancellationhandle) quando ele não for mais necessário.

### Valor retornado

Tipo: **HRESULT**

Retorna `S_OK` se for bem-sucedida; caso contrário, retorna um código de erro.

## Comentários

Chame `WdCreateCancellationHandle` antes de iniciar uma operação de cópia para obter um identificador que permite o cancelamento. Passe o identificador para [WdRemoteCopy](/pt-BR/reference/remoting/functions/wdremotecopy) por meio do parâmetro `cancellationHandle` e, em seguida, passe-o para [WdCancelRemoteCopy](/pt-BR/reference/remoting/functions/wdcancelremotecopy) de um thread separado para cancelar a operação.

Depois que `WdRemoteCopy` retornar, feche o identificador chamando [WdCloseCancellationHandle](/pt-BR/reference/remoting/functions/wdclosecancellationhandle). O identificador pode ser reutilizado em várias chamadas `WdRemoteCopy`, mas cada identificador deve ser fechado em algum momento.

## Requisitos

| Requisito | Valor |
| - | - |
| **Cabeçalho** | WdRemoteIteration.h |
| **Biblioteca** | wdremoteapi.lib |
| **SO com suporte** | Windows 11 e posterior |
| **Arquiteturas com suporte** | x64, ARM64 |

## Confira também

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


## Related topics

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