CoGetCurrentLogicalThreadId function (combaseapi.h)

Returns the logical thread identifier of the current physical thread.


HRESULT CoGetCurrentLogicalThreadId(
  [out] GUID *pguid


[out] pguid

A pointer to a GUID that contains the logical thread ID on return.

Return value

This function can return the following values.

Return code Description
The logical thread ID was retrieved successfully.
An invalid pointer was passed in for the pguid parameter.
A memory allocation failed during the operation of the function.


This function retrieves the identifier of the current logical thread under which this physical thread is operating. The current physical thread takes on the logical thread identifier of any client thread that makes a COM call into this application. Similarly, the logical thread identifier of the current physical thread is used to denote the causality for outgoing COM calls from this physical thread.


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 combaseapi.h (include Objbase.h)
Library Ole32.lib
DLL Ole32.dll