Thread32Next

From aldeid
Jump to navigation Jump to search

Description

Used to iterate through the threads of a process. Injectors use these functions to find an appropriate thread to inject into.

Syntax

BOOL WINAPI Thread32Next(
  _In_   HANDLE hSnapshot,
  _Out_  LPTHREADENTRY32 lpte
);

Parameters

hSnapshot [in]
A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
lpte [out]
A pointer to a THREADENTRY32 structure.

Return value

Returns TRUE if the next entry of the thread list has been copied to the buffer or FALSE otherwise. The ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no threads exist or the snapshot does not contain thread information.