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

# XAsyncGetResultSize

> XAsyncGetResultSize

# XAsyncGetResultSize

Returns the required size of the buffer to pass to [XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult).

## Syntax

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

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

*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](/reference/errorcodes).

## Remarks

If an asynchronous call returns results, call this function prior to calling [XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult) 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](/reference/system/xgamesave/functions/xgamesavegetremainingquotaasync) and [XGameSaveGetRemainingQuotaResult](/reference/system/xgamesave/functions/xgamesavegetremainingquotaresult).

## Requirements

**Header:** XAsync.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)
* [Debugging Game Saves](/build/core-features/common/game-save/game-saves-debugging)

## See also

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


## Related topics

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