August 18th, 2020

What are the possible Status values for Win32_ComputerSystem?

The documentation for the Win32_Computer­System class contains the following documentation for the Status property:

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_Computer­System?

Okay, first the answer, and then the discussion.

The answer is that the Status for a Win32_Computer­System is always “OK”. The computer system itself does not report any interesting status for itself, though it does report status for other things, like Front­Panel­Reset­Status

So why does the Win32_Computer­System even have a Status property if it reports nothing interesting?

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_Computer­System has a Status property not because it wants to report its own status, but because it is forced to report its own status due to inheritance.

This also explains the rambling description: That description was also inherited from CIM_Managed­System­Element. The CIM_Managed­System­Element class needs to describe all of the possible managed system elements, so it has a large variety of status values available, and the documentation tries to explain what those status values mean as they could be applied to arbitrary derived classes.

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.

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

4 comments

Discussion is closed. Login to edit/delete existing comments.

  • Emily Bowman

    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.)

  • Matthew Jackson

    So this ends up being a lot like the BeOS is_computer_on function. I wonder if there’s an equivalent for is_computer_on_fire . . .

    • Piotr Siódmak

      While you’re at it, you could add an IsLiar property.