IDebugProcess2::EnumThreads
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
Retrieves a list of all the threads running in the process.
Syntax
HRESULT EnumThreads(
IEnumDebugThreads2** ppEnum
);
int EnumThreads(
out IEnumDebugThreads2 ppEnum
);
Parameters
ppEnum
[out] Returns an IEnumDebugThreads2 object that contains a list of all threads in all programs in the process.
Return Value
If successful, returns S_OK
; otherwise, returns an error code.
Remarks
This method enumerates the threads running in each program and then combines them into a process view of the threads. A single thread may run in multiple programs; this method enumerates that thread only once.
This method presents a list of the process's threads without duplicates. Otherwise, to enumerate the threads running in a particular program, use the EnumThreads method.