Düzenle

Aracılığıyla paylaş


__ExtendedStatus class

The __ExtendedStatus system class is used to report detailed status and error information.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

class __ExtendedStatus : __NotifyStatus
{
  string Description;
  string Operation;
  string ParameterInfo;
  string ProviderName;
  uint32 StatusCode;
};

Members

The __ExtendedStatus class has these types of members:

Properties

The __ExtendedStatus class has these properties.

Description

Data type: string

Access type: Read-only

Any user-defined string that describes an error or operational status.

Operation

Data type: string

Access type: Read-only

Operation that takes place at the time of a failure or anomaly. Typically, Windows Management Instrumentation (WMI) sets this property to the name of a COM API for WMI method such as the following: IWbemServices::CreateInstanceEnum.

ParameterInfo

Data type: string

Access type: Read-only

Parameters involved in an error or status change. For example, if an application attempts to retrieve a class that does not exist, this property is set to the offending class name.

ProviderName

Data type: string

Access type: Read-only

Identifies the provider that causes or reports an error or status change. If a provider is not involved, this string is set to "Windows Management".

StatusCode

Data type: uint32

Access type: Read-only

Contains an error or information code for an operation. This can be any value defined by the provider, but the value 0 (zero) is usually reserved to indicate success. This property is inherited from __NotifyStatus.

Remarks

The __ExtendedStatus class is derived from the __NotifyStatus class.

Use the __ExtendedStatus class to report information that is more complex than a simple result code. Providers can derive their own classes from __ExtendedStatus if they require more properties to describe the errors.

The StatusCode property, inherited from the __NotifyStatus parent class, is an unsigned integer that represents the error or status value. When instances of this class are returned from a method by a dynamic provider, the StatusCode and Description properties are set by the provider, and the other properties are set by WMI.

Examples

The following VBScript code example describes using __ExtendedStatus to retrieve error information.

Sub sink_OnCompleted(HResult, oErr, oCtx) 
    WScript.Echo "All collections returned" 
  
    if HResult <> 0 Then  
    ' Determine the type of error. 
        If oErr.Path_.Class = "__ExtendedStatus" Then 
            WScript.Echo "WMI Error: "& oErr.Description             
        ElseIf ExtendedStatus.Path_.Class = "SMS_ExtendedStatus" Then 
            WScript.Echo "Provider Error: "& oErr.Description 
            WScript.Echo "Code: " & oErr.ErrorCode 
        End If 
    End If     
    bdone = true 
End sub

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
All WMI namespaces

See also

__NotifyStatus

WMI System Classes