RpcAsyncCompleteCall

The client and the server call the RpcAsyncCompleteCall function to complete an asynchronous remote procedure call.

#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcAsyncCompleteCall(
    PRPC_SYNC_STATE pAsync
     PVOID  Reply 
   );

Parameters

pAsync
Pointer to the RPC_ASYNC_STATE structure that contains asynchronous call information.
Reply
Pointer to a buffer containing the return value of the remote procedure call.

Return Values

Value Meaning
RPC_S_OK Call was canceled successfully
RPC_S_INVALID_ASYNC_HANDLE The asynchronous call handle is not valid
RPC_S_ASYNC_CALL_PENDING The call has not yet completed

Remarks

Completes the asynchronous RPC call. Both client and server call this function.

Client: Reply points to a buffer that will receive the reply. If the client calls this function before the reply has arrived, the call returns RPC_S_ASYNC_CALL_PENDING. The buffer must be valid and it must be big enough to receive the return value. If this call is successful, the [out] and the [in, out] parameters are valid.

Server: Reply points to a buffer that contains the return value that needs to be sent to the client. The buffer must be valid. Before a call to RpcAsyncCompleteCall is made, the out and in, out parameters must be updated. These parameters, and the asynchronous handle, should not be touched after the call to RpcAsyncCompleteCall returns.

See Also

Asynchronous RPC, RPC_ASYNC_STATE, RpcAsyncAbortCall, RpcAsyncCancelCall, RpcAsyncGetCallHandle, RpcAsyncGetCallStatus, RpcAsyncInitializeHandle, RpcAsyncRegisterInfo, RpcServerTestCancel