Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

RpcSmGetThreadHandle function

The RpcSmGetThreadHandle function returns a thread handle, or NULL, for the stub memory–management environment.

Syntax


RPC_SS_THREAD_HANDLE RPC_ENTRY RpcSmGetThreadHandle(
  RPC_STATUS *pStatus
);

Parameters

pStatus

Pointer to the returned status.

Return value

ValueMeaning
RPC_S_OK

The call succeeded.

 

Note  For a list of valid error codes, see RPC Return Values.

Remarks

Applications call RpcSmGetThreadHandle to obtain a thread handle for the stub memory–management environment. A thread used to manage memory for the stub memory–management environment uses RpcSmGetThreadHandle to receive a handle for its memory environment. In this way, another thread that calls RpcSmSetThreadHandle by using this handle can then use the same memory-management environment.

The same memory management thread handle must be used by multiple threads calling RpcSmAllocate and RpcSmFree in order to manage the same memory. Before spawning new threads to manage the same memory, the thread that established the memory-management environment (parent thread) calls RpcSmGetThreadHandle to obtain a thread handle for this environment. Then, the spawned threads call RpcSmSetThreadHandle with the new manager handle provided by the parent thread.

Typically a server manager procedure calls RpcSmGetThreadHandle before additional threads are spawned. The stub sets up the memory-management environment for the manager procedure, and the manager calls RpcSmGetThreadHandle to make this environment available to the other threads.

A thread can also call RpcSmGetThreadHandle and RpcSmSetThreadHandle to save and restore its memory-management environment.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Rpcndr.h (include Rpc.h)

Library

Rpcrt4.lib

DLL

Rpcrt4.dll

See also

RpcSmAllocate
RpcSmFree
RpcSmSetThreadHandle

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.