XAsyncCancel

Attempts to cancel an asynchronous call.

Syntax

void XAsyncCancel(  
         XAsyncBlock* asyncBlock  
)  

Parameters

asyncBlock   _Inout_
Type: XAsyncBlock*

A pointer to the XAsyncBlock for the asynchronous call.

Return value

Type: void

Remarks

If the XAsyncCancel function is invoked for an asynchronous call that has not yet completed, the XAsyncGetResult, XAsyncGetResultSize, and XAsyncGetStatus functions return E_ABORT and completion of the asynchronous call is signalled. Cancellation may happen synchronously, asynchronously, or not at all, depending on the call being canceled. If a completion callback was specified for the asynchronous call, it is then invoked. For more information about completion callbacks, see XAsyncCompletionRoutine.

If the XAsyncCancel function is invoked for an asynchronous call that has already completed, nothing happens.

Requirements

Header: XAsync.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XAsyncCompletionRoutine
XAsync Members
Asynchronous Programming Model