Debugging Tools for Windows

GetThreadIdByHandle

The GetThreadIdByHandle method returns the engine thread ID for the specified thread. The thread is specified by its system handle.

HRESULT
  IDebugSystemObjects::GetThreadIdByHandle(
    IN ULONG64  Handle,
    OUT PULONG  Id
    );

Parameters

Handle
Specifies the system handle of the thread whose thread ID is requested.
Id
Receives the engine thread ID.

Return Value

S_OK
The method was successful.

This method may also return error values. See Return Values for more details.

Interface Version

GetThreadIdByHandle is available in all versions of IDebugSystemObjects.

Comments

In kernel-mode debugging, because the handle is an artificial handle for a processor, this method returns the engine thread ID for the virtual thread representing that processor.

For more information about threads, see Threads and Processes. For details on system handles, see Handles.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

Build machine: CAPEBUILD