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

# XAsyncGetResultSize

> XAsyncGetResultSize

Returns the required size of the buffer to pass to [XAsyncGetResult](https://docs.xbox.com/reference/system/xasyncprovider/functions/xasyncgetresult.md).

## Syntax

```cpp theme={null}
HRESULT XAsyncGetResultSize(  
         XAsyncBlock* asyncBlock,  
         size_t* bufferSize  
)  
```

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

*bufferSize*   \_Out\_\
Type: size\_t\*

The required size, in bytes, of the buffer needed to hold the results.

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

If an asynchronous call returns results, call this function prior to calling [XAsyncGetResult](https://docs.xbox.com/reference/system/xasyncprovider/functions/xasyncgetresult.md) to specify the size of the buffer required to hold the results. Each asynchronous call that returns results must have a corresponding function that can be called to return the results from that asynchronous call.

For an example of an asynchronous call with a corresponding function to return results, see [XGameSaveGetRemainingQuotaAsync](https://docs.xbox.com/reference/system/xgamesave/functions/xgamesavegetremainingquotaasync.md) and [XGameSaveGetRemainingQuotaResult](https://docs.xbox.com/reference/system/xgamesave/functions/xgamesavegetremainingquotaresult.md).

## Requirements

**Header:** XAsync.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Asynchronous Programming Model](https://docs.xbox.com/build/core-features/common/async/async-programming-model.md)
* [Debugging Game Saves](https://docs.xbox.com/build/core-features/common/game-save/game-saves-debugging.md)

## See also

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


## Related topics

- [XAsync (API contents)](https://docs.xbox.com/reference/system/xasync/xasync_members.md)
- [XAsyncCancel](https://docs.xbox.com/reference/system/xasync/functions/xasynccancel.md)
- [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md)
- [Debugging Game Saves](https://docs.xbox.com/build/core-features/common/game-save/game-saves-debugging.md)
- [Asynchronous Programming Model](https://docs.xbox.com/build/core-features/common/async/async-programming-model.md)
