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

# AsyncProviderData

> AsyncProviderData

# AsyncProviderData

Represents data passed to the callback function of an asynchronous provider.

## Syntax

```cpp theme={null}
typedef struct XAsyncProviderData {  
    XAsyncBlock* async;  
    size_t bufferSize;  
    void* buffer;  
    void* context;  
} XAsyncProviderData  
```

### Members

*async*\
Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

A pointer to the [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) that holds data for the asynchronous call.

*bufferSize*\
Type: size\_t

The size, in bytes, of the result buffer specified in *buffer*. This value is valid only when the callback function is called with an [XAsyncOp::GetResult](/reference/system/xasyncprovider/enums/xasyncop) operation code, and the value will be equal to or greater than the value specified for the *requiredBufferSize* parameter of the corresponding [XAsyncComplete](/reference/system/xasyncprovider/functions/xasynccomplete) function call.

*buffer*\
Type: void\*

A pointer to the result buffer for the callback function. This value is valid only when the callback function is called with an [XAsyncOp::GetResult](/reference/system/xasyncprovider/enums/xasyncop) operation code.

*context*\
Type: void\*

A context pointer passed to the callback function when [XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin) was called.

## Remarks

This structure represents data passed to the callback function for an asynchronous provider. The data in this structure can change each time the callback function is called. The callback function is repeatedly called to perform asynchronous work determined by the [XAsyncOp](/reference/system/xasyncprovider/enums/xasyncop) operation code specified for each call, and the data in this structure can also change with each call. The values for *buffer* and *bufferSize* are valid only when the callback function is called with the `XAsyncOp::GetResult` operation code. The value for *context* is valid when the callback function is called with any operation code, but should be freed only when the callback function is called with the `XAsyncOp::Cleanup` operation code.

For an example of a callback function that interacts with `XAsyncProviderData` when performing asynchronous work for the `GetResult`, and `Cleanup` operation codes from `XAsyncOp`, see the "Async Library" section in [Asynchronous Programming Model](/build/core-features/common/async/async-programming-model#heading-7).

## Requirements

**Header:** XAsyncProvider.h

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

## See also

[XAsyncProvider Members](/reference/system/xasyncprovider/xasyncprovider_members)\
[XAsyncComplete](/reference/system/xasyncprovider/functions/xasynccomplete)\
[XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin)\
[XAsyncOp](/reference/system/xasyncprovider/enums/xasyncop)\
[Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)


## Related topics

- [XAsyncProvider](/reference/system/xasyncprovider/xasyncprovider_members.md)
- [XAsyncProvider function](/reference/system/xasyncprovider/functions/xasyncprovider.md)
- [XAsyncProvider library overview](/build/core-features/common/async/async-libraries/async-library-xasyncprovider.md)
- [XAsyncOp](/reference/system/xasyncprovider/enums/xasyncop.md)
- [XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin.md)
