Share via


XAsyncGetStatus

Returns the status of the asynchronous call, optionally waiting for it to complete.

Syntax

HRESULT XAsyncGetStatus(  
         XAsyncBlock* asyncBlock,  
         bool wait  
)  

Parameters

asyncBlock   _Inout_
Type: XAsyncBlock*

A pointer to the XAsyncBlock that was passed to the asynchronous call.

wait   _In_
Type: bool

If true, XAsyncGetStatus waits until the asynchronous call either completes or is canceled.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

Once the asynchronous call is complete, you can then call XAsyncGetResult to get the results if the asynchronous call has a resulting data payload. If the asynchronous call doesn't have a resulting data payload, you don't have to call XAsyncGetResult.

Note: Both a completion callback and XAsyncGetStatus with a wait parameter of true can be used to identify when a call has finished. The ordering of these calls can be ambiguous and as a best practice you should not use both for the same call.

Requirements

Header: XAsync.h

Library: xgameruntime.lib

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

See also

XAsync Members
XAsyncGetResult
Asynchronous Programming Model