RpcSsSetClientAllocFree

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        
);
 

Parameters

pfnAllocate
Specifies the routine used to allocate memory.
pfnFree
Specifies the routine used to release memory and used with the routine specified by pfnAllocate.

Remarks

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.

Return Values

Value Meaning
RPC_S_OUT_OF_MEMORY Out of memory

QuickInfo

  Windows NT: Yes
  Windows CE: Unsupported.
  Header: Declared in rpcndr.h.
  Import Library: Link with rpcrt4.lib.

See Also

RpcSmSetClientAllocFree, RpcSsAllocate, RpcSsFree