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

# XAsyncGetStatus

> 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\*](/reference/system/xasync/structs/xasyncblock)

A pointer to the [XAsyncBlock](/reference/system/xasync/structs/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](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](/reference/errorcodes).

## Remarks

Once the asynchronous call is complete, you can then call [XAsyncGetResult](/reference/system/xasyncprovider/functions/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](/reference/system/xasyncprovider/functions/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

## Conceptual documentation

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

## See also

[XAsync Members](/reference/system/xasync/xasync_members)\
[XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult)\
[Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)


## Related topics

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