THREADENTRY32 (Windows CE 5.0)

Send Feedback

This structure describes an entry from a list that enumerates the threads executing in the system when a snapshot was taken.

typedef struct tagTHREADENTRY32 { DWORD dwSize; DWORD cntUsage; DWORD th32ThreadID; DWORD th32OwnerProcessID; LONG tpBasePri; LONG tpDeltaPri; DWORD dwFlags;DWORD th32AccessKey;DWORD th32CurrentProcessID;} THREADENTRY32; typedef THREADENTRY32* PTHREADENTRY32; typedef THREADENTRY32* LPTHREADENTRY32;

Members

  • dwSize
    Length, in bytes, of the structure.

    Before calling the Thread32First function, set this member to sizeof(THREADENTRY32).

    If you do not initialize dwSize, Thread32First fails.

  • cntUsage
    Number of references to the thread.

    A thread exists as long as its usage count is nonzero.

    As soon as its usage count becomes zero, a thread terminates.

  • th32ThreadID
    Identifier of the thread.

    This identifier is compatible with the thread identifier returned by the CreateProcess function.

  • th32OwnerProcessID
    Identifier of the process that created the thread.

    The contents of this member can be used by Win32 API elements.

  • tpBasePri
    Initial priority level assigned to a thread, which can be a value from 0 to 255.

  • tpDeltaPri
    Change in the priority level of a thread.

    This value is a signed delta from the base priority level assigned to the thread.

  • dwFlags
    Reserved; do not use.

  • th32AccessKey
    Array of bits. Each bit signifies permission to see the address space of one process.

    In the THREADENTRY32 structure, the key contains the bits the thread has, thus defining the processes it can see.

  • th32CurrentProcessID
    Process identifier where the thread is executing.

Remarks

To use the process and thread identifiers with GetThreadTimes and other functions that take process handles, the identifiers can be cast directly to process and thread handles. However, accessing THREADENTRY32 for other processes requires using the SetProcPermissions function to enable access to the other process's slot.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Tlhelp32.h.

See Also

CreateProcess | Thread32First | GetThreadTimes | SetProcPermissions | Memory Architecture

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.