RpcSsSetClientAllocFree function (rpcndr.h)

The RpcSsSetClientAllocFree function enables the memory allocation and release mechanisms used by the client stubs.

Syntax

void RpcSsSetClientAllocFree(
  RPC_CLIENT_ALLOC *ClientAlloc,
  RPC_CLIENT_FREE  *ClientFree
);

Parameters

ClientAlloc

Memory-allocation function.

ClientFree

Memory-releasing function used with the memory-allocation function specified by pfnAllocate.

Return value

Value Meaning
RPC_S_OUT_OF_MEMORY
The system is out of memory.
 
Note  For a list of valid error codes, see RPC Return Values.
 

Remarks

By overriding the default routines used by the client stub to manage memory, RpcSsSetClientAllocFree 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 RpcSsSetClientAllocFree reclaims the memory resources, it also makes the context handle NULL.

Note  RpcSsSetClientAllocFree raises exceptions, unlike RpcSmSetClientAllocFree, which returns the error code.
 

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header rpcndr.h (include Rpc.h)
Library Rpcrt4.lib
DLL Rpcrt4.dll

See also

RpcSmSetClientAllocFree

RpcSsAllocate

RpcSsFree