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

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

## Sintaxe

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

### Parâmetros

`_Out_ cancellationHandle`\
Tipo: **[WdCancellationHandle](https://docs.xbox.com/pt-BR/reference/remoting/structs/wdcancellationhandle.md)\***

Recebe o identificador de cancelamento recém-criado. O chamador é responsável por liberar esse identificador chamando [WdCloseCancellationHandle](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdclosecancellationhandle.md) 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](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdremotecopy.md) por meio do parâmetro `cancellationHandle` e, em seguida, passe-o para [WdCancelRemoteCopy](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdcancelremotecopy.md) de um thread separado para cancelar a operação.

Depois que `WdRemoteCopy` retornar, feche o identificador chamando [WdCloseCancellationHandle](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdclosecancellationhandle.md). 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](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdclosecancellationhandle.md)
* [WdDuplicateCancellationHandle](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdduplicatecancellationhandle.md)
* [WdCancellationHandle](https://docs.xbox.com/pt-BR/reference/remoting/structs/wdcancellationhandle.md)
* [WdRemoteCopy](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdremotecopy.md)
* [WdCancelRemoteCopy](https://docs.xbox.com/pt-BR/reference/remoting/functions/wdcancelremotecopy.md)
* [XBOX PC Remote Iteration API](https://docs.xbox.com/pt-BR/reference/remoting/remoteiteration_members.md)


## Related topics

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