The RpcSsSetClientAllocFree function enables the memory allocation and release mechanisms used by the client stubs.
#include <rpc.h>
void RPC_ENTRY RpcSsSetClientAllocFree(
RPC_CLIENT_ALLOC * pfnAllocate,
RPC_CLIENT_FREE * pfnFree
);
By overriding the default routines used by the client stub to manage memory, the RpcSsSetClientAllocFree routine establishes the memory allocation and memory freeing mechanisms. Note that the default routines are free and malloc, unless the remote call occurs within manager code. In this case, the default memory management routines are RpcSsFree and RpcSsAllocate.
Note that when this routine reclaims the memory resources, it also makes the context handle NULL.
Note The RpcSsSetClientAllocFree routine raises exceptions, while the RpcSmSetClientAllocFree routine returns the error code.
Value | Meaning |
---|---|
RPC_S_OUT_OF_MEMORY | Out of memory |
Windows NT: Yes
Windows CE: Unsupported.
Header: Declared in rpcndr.h.
Import Library: Link with rpcrt4.lib.
RpcSmSetClientAllocFree, RpcSsAllocate, RpcSsFree