XAsyncComplete
Indicates that the callback function for an asynchronous provider has completed work and the results can be returned.Syntax
Parameters
asyncBlock _Inout_Type: XAsyncBlock* A pointer to the XAsyncBlock that was passed to XAsyncBegin. result _In_
Type: HRESULT The result of the work performed by the callback function. If the work is canceled, set this to
E_ABORT. If more work needs to be done, set this to E_PENDING. Otherwise, set this to the appropriate result code.
requiredBufferSize _In_Type: size_t The required size, in bytes, of the data payload to be returned by the callback function. If the callback function doesn’t return a data payload, set this value to zero. This parameter is ignored if the callback function returns an error.
Return value
Type: voidRemarks
This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
XAsyncOp::DoWork operation code, the callback function should perform asynchronous work. If the callback function has completed all asynchronous work, set result to an appropriate error code. If more work needs to be done, set result to E_PENDING. If the function returns a data payload, set requiredBufferSize to the size, in bytes, of the buffer needed to return the data payload; otherwise, set requiredBufferSize to zero.
If the callback function has been called with the XAsyncOp::Cancel operation code, the callback function should cancel asynchronous work. Set result to E_ABORT and requiredBufferSize to zero.
Requirements
Header: XAsyncProvider.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesConceptual documentation
- Set up cancelability
- Set up custom provider
- Set up return data
- Asynchronous Programming Model
- Time-sensitive threads
See also
XAsyncProvider MembersXAsyncBegin
Asynchronous Programming Model
