Win32_Thread class
The Win32_Thread WMI 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.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.
Syntax
class Win32_Thread : CIM_Thread
{
string Caption;
string CreationClassName;
string CSCreationClassName;
string CSName;
string Description;
uint64 ElapsedTime;
uint16 ExecutionState;
string Handle;
datetime InstallDate;
uint64 KernelModeTime;
string Name;
string OSCreationClassName;
string OSName;
uint32 Priority;
uint32 PriorityBase;
string ProcessCreationClassName;
string ProcessHandle;
uint32 StartAddress;
string Status;
uint32 ThreadState;
uint32 ThreadWaitReason;
uint64 UserModeTime;
};
Members
The Win32_Thread class has these types of members:
Properties
The Win32_Thread class has these properties.
- Caption
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (64)
Short description of the object.
- CreationClassName
-
Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, this property allows all instances of this class and its subclasses to be uniquely identified.
- CSCreationClassName
-
Creation class name of the scoping computer system.
- CSName
-
Name of the scoping computer system.
- Description
-
- Data type: string
- Access type: Read-only
Description of the object.
- ElapsedTime
-
- Data type: uint64
- Access type: Read-only
- Qualifiers: Units (Milliseconds)
Total execution time given to this thread since its creation.
For more information about using uint64 values in scripts, see Scripting in WMI.
- ExecutionState
-
- Data type: uint16
- Access type: Read-only
Current operating condition of the thread.
Value Meaning - 0
Unknown
- 1
Other
- 2
Ready
- 3
Running
- 4
Blocked
- 5
Suspended Blocked
- 6
Suspended Ready
- Handle
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (256)
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
- Access type: Read-only
Object was installed. This property does not need a value to indicate that the object is installed.
- KernelModeTime
-
- Data type: uint64
- Access type: Read-only
Time in kernel mode, in 100 nanosecond units. If this information is not available, a value of 0 (zero) should be used.
For more information about using uint64 values in scripts, see Scripting in WMI.
- Name
-
- Data type: string
- Access type: Read-only
Label by which the object is known. When subclassed, the property can be overridden to be a key property.
- OSCreationClassName
-
- Data type: string
- Access type: Read-only
Creation class name of the scoping operating system.
- OSName
-
Name of the scoping operating system.
- Priority
-
- Data type: uint32
- Access type: Read-only
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
- Access type: Read-only
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 property can have a value between 0 and 31.
- ProcessCreationClassName
-
Value of the scoping process CreationClassName property.
- ProcessHandle
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (256)
Process that created the thread. The contents of this property can be used by Windows application programming interface (API) elements.
- StartAddress
-
- Data type: uint32
- Access type: Read-only
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.
- Status
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (10)
Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "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 online, yet the managed element is neither "OK" nor in one of the other states.
The values are:
- "OK"
- "Error"
- "Degraded"
- "Unknown"
- "Pred Fail"
- "Starting"
- "Stopping"
- "Service"
- ThreadState
-
- Data type: uint32
- Access type: Read-only
Current execution state for the thread.
- ThreadWaitReason
-
- Data type: uint32
- Access type: Read-only
Reason why the thread is waiting. This value is only valid if the ThreadState member is set to Waiting (6). Event pairs allow communication with protected subsystems.
- UserModeTime
-
- Data type: uint64
- Access type: Read-only
Time in user mode, in 100 nanoseconds units. If this information is not available, a value of 0 (zero) should be used.
For more information about using uint64 values in scripts, see Scripting in WMI.
Remarks
The Win32_Thread class is derived from CIM_Thread.
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 11/19/2012
