The documentation for the Win32_
Status
Data type: string
Access type: Read-only
Qualifiers: MaxLen (10), DisplayName (“Status”)
Current status of an object. Various operational and nonoperational statuses can be defined. Operational statuses include: OK, Degraded, and Pred Fail, which is an element such as a SMART-enabled hard disk drive that may be functioning properly, but predicts a failure in the near future. Nonoperational statuses include: Error, Starting, Stopping, and Service, which can apply during mirror-resilvering of a disk, reloading a user permissions list, or other administrative work. Not all status work is online, but the managed element is not OK or in one of the other states.
This property is inherited from CIM_
ManagedÂSystemÂElement. Values include the following:
OK (“OK”)
Error (“Error”)
Degraded (“Degraded”)
Unknown (“Unknown”)
Pred Fail (“Pred Fail”)
Starting (“Starting”)
Stopping (“Stopping”)
Service (“Service”)
Stressed (“Stressed”)
NonRecover (“NonRecover”)
No Contact (“No Contact”)
Lost Comm (“Lost Comm”)
What is all this gibberish trying to say? And what does it tell us about the possible Status values for a Win32_
Okay, first the answer, and then the discussion.
The answer is that the Status for a Win32_
So why does the Win32_
The clue for that is in the comment that snuck in between the description and the list of status values:
This property is inherited from CIM_
ManagedÂSystemÂElement.
The Win32_
This also explains the rambling description: That description was also inherited from CIM_
Some reformatting and additional clarifying words might help:
Current status of an object.
Various operational and nonoperational statuses can be defined.
Operational statuses include: OK, Degraded, and Pred Fail. (Pred Fail is reported by an element such as a SMART-enabled hard disk drive that may be functioning properly, but predicts a failure in the near future.)
Nonoperational statuses include: Error, Starting, Stopping, and Service. (Service can be reported during mirror-resilvering of a disk, reloading a user permissions list, or other administrative work. Such work may force the element to go offline temporarily.)
This property is inherited from CIM_
ManagedÂSystemÂElement. Not all status values described here may apply to a derived class.
But really, the description for that property should be marked as non-inherited (even though the property is inherited), and a custom description used instead:
Current status of an object.
For Win32_
ComputerÂSystem the Status is always “OK”. This property is inherited from CIM_
ManagedÂSystemÂElement.
And that’s what the documentation says as of last week.
Some of the best javadoc WTFs I’ve seen are things obviously inheriting impossible things from their parents. As always, thanks for the cleanup; documentation is thankless but so invaluable to those of us who have to use it. (Though I consider this blog unofficial documentation of most of Win32 anyway.)
Thanks for being that someone Raymond.
( https://devblogs.microsoft.com/oldnewthing/20110118-00/?p=11733 )
So this ends up being a lot like the BeOS
is_computer_on
function. I wonder if there’s an equivalent foris_computer_on_fire
. . .While you’re at it, you could add an IsLiar property.