Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetCurrentThreadID Method

ICorProfilerInfo::GetCurrentThreadID Method

Gets the ID of the current thread, if it is a managed thread.

HRESULT GetCurrentThreadID(
    [out] ThreadID *pThreadId);


[out] A pointer to the returned ID of the managed thread.

If the current thread is an internal runtime thread or other unmanaged thread, GetCurrentThreadID returns CORPROF_E_NOT_MANAGED_THREAD as the HRESULT, and the returned value of the pThreadId parameter will be null.

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: 4.6, 4.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

© 2015 Microsoft