RpcSmFree function (rpcndr.h)

The RpcSmFree function releases memory allocated by RpcSmAllocate.

Syntax

RPC_STATUS RpcSmFree(
  void *NodeToFree
);

Parameters

NodeToFree

Pointer to memory allocated by RpcSmAllocate or RpcSsAllocate.

Return value

The function RpcSmFree returns the following value.

Value Meaning
RPC_S_OK
The call succeeded.
 
Note  For a list of valid error codes, see RPC Return Values.
 

Remarks

Applications use RpcSmFree to free memory allocated by RpcSmAllocate. In cases where the stub allocates the memory for the application, RpcSmFree can also be used to release memory. For more information, see Memory Management.

To improve performance, the RpcSmFree function only marks memory for release. Memory is not actually released until your application calls the RpcSmDisableAllocate function. To release memory immediately, invoke the midl_user_free function.

Note that the handle of the thread calling RpcSmFree must match the handle of the thread that allocated the memory by calling RpcSmAllocate.. Use RpcSmGetThreadHandle and RpcSmSetThreadHandle to pass handles from thread to thread.

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

RpcSmAllocate

RpcSmGetThreadHandle

RpcSmSetThreadHandle

midl_user_allocate