The client calls the RpcAsyncInitializeHandle function to initialize the RPC_ASYNC_STATE structure so that it can be used to make an asynchronous call.
#include <rpc.h> //function defined in rpcasync.h
RPC_STATUS RPC_ENTRY RpcAsyncInitializeHandle(
PRPC_ASYNC_STATE pAsync
unsigned int Size
);
Value | Description |
---|---|
RPC_S_OK | The call succeeded. |
RPC_S_INVALID_ARG | The size is either too small or too large. |
RPC_S_INVALID_ASYNC_HANDLE | pAsync points to invalid memory. |
The client creates a new RPC_ASYNC_STATE structure and a pointer that structure and calls RpcAsyncInitializeHandle with the pointer as an input parameter. The RPC run-time environment initializes the fields that it uses to maintain the state of an asynchronous remote call, and sets the Size parameter to the size of the structure. When the call to RpcAsyncInitializeHandle returns successfully, the client can set the notification type and any fields related to that notification type in the RPC_ASYNC_STATE structure. The client application uses a pointer to this structure to make an asynchronous call.
Asynchronous RPC, RPC_ASYNC_STATE, RpcAsyncAbortCall, RpcAsyncCancelCall, RpcAsyncCompleteCall, RpcAsyncGetCallHandle, RpcAsyncGetCallStatus, RpcAsyncRegisterInfo, RpcServerTestCancel