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

# XAsyncGetStatus

> XAsyncGetStatus

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

## Syntax

```cpp theme={null}
HRESULT XAsyncGetStatus(  
         XAsyncBlock* asyncBlock,  
         bool wait  
)  
```

### Parameters

*asyncBlock*   \_Inout\_\
Type: [XAsyncBlock\*](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md)

A pointer to the [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md) 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](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

Returns `S_OK` if successful; otherwise, returns an error code. For a list of error codes, see [Error Codes](https://docs.xbox.com/reference/errorcodes.md).

## Remarks

Once the asynchronous call is complete, you can then call [XAsyncGetResult](https://docs.xbox.com/reference/system/xasyncprovider/functions/xasyncgetresult.md) 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](https://docs.xbox.com/reference/system/xasyncprovider/functions/xasyncgetresult.md).

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

## Conceptual documentation

* [Run simple task](https://docs.xbox.com/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task.md)
* [XAsync library overview](https://docs.xbox.com/build/core-features/common/async/async-libraries/async-library-xasync.md)
* [Set up custom provider](https://docs.xbox.com/build/core-features/common/async/async-libraries/async-library-xasyncprovider-example-setup-custom-provider.md)
* [Asynchronous Programming Model](https://docs.xbox.com/build/core-features/common/async/async-programming-model.md)
* [Asynchronous programming design goals and improvements](https://docs.xbox.com/build/core-features/common/async/async-whitepaper.md)

## See also

[XAsync Members](https://docs.xbox.com/reference/system/xasync/xasync_members.md)\
[XAsyncGetResult](https://docs.xbox.com/reference/system/xasyncprovider/functions/xasyncgetresult.md)\
[Asynchronous Programming Model](https://docs.xbox.com/build/core-features/common/async/async-programming-model.md)


## Related topics

- [Making Async Calls](https://docs.xbox.com/services/playfab/sdks/c/async.md)
- [Making async calls in the XSAPI C API](https://docs.xbox.com/services/xbox-services/fundamentals/xbox-services-api/live-flatc-async-patterns.md)
- [XAsyncGetResultSize](https://docs.xbox.com/reference/system/xasync/functions/xasyncgetresultsize.md)
- [Making async calls in the PlayFab Unified SDK](https://docs.xbox.com/services/playfab/sdks/unified-sdk/async-model.md)
- [XblAchievementsUpdateAchievementAsync](https://docs.xbox.com/reference/live/xsapi-c/achievements_c/functions/xblachievementsupdateachievementasync.md)
