ICorDebugProcess::GetHelperThreadID Method

Gets the operating system (OS) thread ID of the debugger's internal helper thread.


HRESULT GetHelperThreadID (  
    [out] DWORD *pThreadID  


[out] A pointer to the OS thread ID of the debugger's internal helper thread.


During managed and unmanaged debugging, it is the debugger's responsibility to ensure that the thread with the specified ID remains running if it hits a breakpoint placed by the debugger. A debugger may also wish to hide this thread from the user. If no helper thread exists in the process yet, the GetHelperThreadID method returns zero in *pThreadID.

You cannot cache the thread ID of the helper thread, because it may change over time. You must re-query the thread ID at every stopping event.

The thread ID of the debugger's helper thread will be correct on every unmanaged ICorDebugManagedCallback::CreateThread event, thus allowing a debugger to determine the thread ID of its helper thread and hide it from the user. A thread that is identified as a helper thread during an unmanaged ICorDebugManagedCallback::CreateThread event will never run managed user code.


Platforms: See System Requirements.

Header: CorDebug.idl. CorDebug.h

Library: CorGuids.lib

.NET Framework Versions: Available since 1.0