Win32_Thread

The Win32_Thread class represents a thread of execution.While a process must have one thread of execution, the process can create other threads to execute tasks in parallel. Threads share the process environment, thus multiple threads under the same process use less memory than the same number of processes.

Quick Start

Properties

In this WMI class, all WMI properties are read-only. You can only read values but not change them.

Caption

Data type String

The Caption property is a short textual description (one-line string) of the object.

CreationClassName

Data type String

CreationClassName indicates the name of the class or the subclass used in the creation of an instance. When used with the other key properties of this class, this property allow all instances of this class and its subclasses to be uniquely identified.

CSCreationClassName

Data type String

The scoping computer system’s creation class name.

CSName

Data type String

The scoping computer system’s name.

Description

Data type String

The Description property provides a textual description of the object.

DesktopInteract

Data type Boolean

DisplayName

Data type String

ElapsedTime

Data type UInt64

The ElapsedTime property indicates the total execution time given to this thread since its creation.

ErrorControl

Data type UInt8

ExecutionState

Data type UInt16

Indicates the current operating condition of the thread. Values include ready (2), running (3), and blocked (4), among others.

Handle

Data type String

The Handle property represents a handle to a thread. The handle has full access rights by default. With the correct security access, the handle can be used in any function that accepts a thread handle. Depending on the inheritance flag specified when it is created, this handle can be inherited by child processes.

InstallDate

Data type DateTime

The InstallDate property is datetime value indicating when the object was installed. A lack of a value does not indicate that the object is not installed.

KernelModeTime

Data type UInt64

The KernelModeTime property indicates the raw counter data from the performance counter type

PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT

The counter data is in 100 nanosecond units.

LoadOrderGroup

Data type String

LoadOrderGroupDependencies

Data type String

Name

Data type String

The Name property defines the label by which the object is known. When subclassed, the Name property can be overridden to be a Key property.

OSCreationClassName

Data type String

The scoping operating system’s creation class name.

OSName

Data type String

The scoping operating system’s name.

PathName

Data type String

Priority

Data type UInt32

The Priority property indicates the dynamic priority of the thread. Each thread has a dynamic priority that the scheduler uses to determine which thread to execute. Initially, a thread’s dynamic priority is the same as its base priority. The system can raise and lower the dynamic priority, to ensure that it is responsive (guaranteeing that no threads are starved for processor time). The system does not boost the priority of threads with a base priority level between 16 and 31. Only threads with a base priority between 0 and 15 receive dynamic priority boosts. Higher numbers indicate higher priorities.

PriorityBase

Data type UInt32

The PriorityBase property indicates the current base priority of a thread. The operating system may raise the thread’s dynamic priority above the base priority if the thread is handling user input, or lower it toward the base priority if the thread becomes compute-bound. The PriorityBase propertycan have a value between 0 and 31

ProcessCreationClassName

Data type String

The scoping process’ CreationClassName.

ProcessHandle

Data type String

The ProcessHandle property indicates the process that created the thread. The contents of this property can be used by Win32 API elements.

ServiceDependencies

Data type String

ServiceType

Data type UInt8

StartAddress

Data type UInt32

The StartAddress property indicates the starting address of the thread. Because any application with appropriate access to the thread can change the thread’s context, this value may only be an approximation of the thread’s starting address.

StartMode

Data type String

$StartMode_ReturnValue = 
@{
  Boot=
  System='(unknown)'
  Automatic='(unknown)'
  Manual='(unknown)'
  Disabled='(unknown)'
}

StartName

Data type String

StartPassword

Data type String

Status

Data type String

The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are “OK”, “Degraded” and “Pred Fail”. “Pred Fail” indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are “Error”, “Starting”, “Stopping” and “Service”. The latter, “Service”, could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither “OK” nor in one of the other states.

'OK','Error','Degraded','Unknown','Pred Fail','Starting','Stopping','Service','Stressed','NonRecover','No Contact','Lost Comm'

ThreadState

Data type UInt32

The ThreadState property indicates the current execution state for the thread. A thread can have one of eight values: Initialized (recognized by the microkernel), Ready (prepared to run on next available processor), Running (executing), Standby (about to run, only one thread may be in this state at a time), Terminated (finished executing), Waiting (not ready for the processor, when ready, it will be rescheduled), Transition (thread is waiting for resources other than the processor), and Unknown (the thread state is unknown).

ThreadWaitReason

Data type UInt32

The ThreadWaitReason property indicates why the thread is waiting. The value is only valid if the ThreadState member is set to Waiting. Values of 0 or 7 denote that the thread is waiting for the Executive, 1 or 8 for a Free Page, 2 or 9 for a Page In, 3 or 10 for a Pool Allocation, 4 or 11 for an Execution Delay, 5 or 12 for a Suspended condition, 6 or 13 for a User Request, 14 for an Event Pair High, 15 for an Event Pair Low, 16 for an Local Procedure Call (LPC) Receive, 17 for an LPC Reply, 18 for Virtual Memory, 19 for a Page Out. 20 and higher are not assigned. Event Pairs allow communication with protected subsystems (see Context Switches).

UserModeTime

Data type UInt64

The UserModeTime property indicates the raw counter data from the performance counter type

PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT

The counter data is in 100 nanosecond units.

Methods

Examples

Help and Questions

  Community Content

You are cordially invited to add knowledge to this page. If you have sample code or additional information related to this WMI class, please share it. Use the comment form to send your information. We will edit and incorparate it into the reference library. Thank you!

Please do not use the comment form to submit questions. If you have questions or need assistance, visit our free forum: Help me with WMI.

Content last updated: 2013-12-27 12:20:02 (UTC).

Facebooktwittergoogle_pluspinterestlinkedinFacebooktwittergoogle_pluspinterestlinkedin