This section details how to handle errors generated by NCS2 WMI Provider.
How and when an error object is returned depends on whether a call is synchronous, semi-synchronous or asynchronous. In most cases, the HRESULT is set to WBEM_E_FAILED when an error occurs. At this point, however, it is unknown whether WMI or the NCS2 WMI Provider generated the error.
Use GetErrorInfo() to get the IErrorInfo object. Use QueryInterface() to get the IWbemClassObject that contains the error information.
The IWbemClassObject is passed back as the last item in the last SetStatus() call.
After you get the error object instance, you can check the __Class property to determine the origin of the error. WMI creates an instance of __ExtendedStatus, and the NCS2 WMI Provider creates an instance of IANet_ExtendedStatus for errors relating to IANet_ classes and NCS2 WMI Provider.
IANet_ExtendedStatus is derived from __ExtendedStatus and contains the following attributes:
Context Qualifier | Description |
Description | Description of the error tailored to the current locale |
File | Code file where the error was generated |
Line | Line number in the code file with the error |
ParameterInfo | Class or attribute that was being utilized when the error occurred |
Operation | Operation being attempted when the error occurred |
ProviderName | Name of the Provider that caused the error |
StatusCode | Code returned from the internal call that failed |
ClientSetHandle | Client Set handle used for the operation |
RuleFailureReasons | Reason for operation failure. An operation can fail because a technical rule has failed. (e.g., you must have a management adapter in certain teams). |
For all error codes, the NCS2 WMI Providers gives a description customized to the locale. Below is a list of possible error codes that the Provider may return. Error codes are in the form of HRESULT with severity set to one (1) and facility set to ITF. An application may use these codes as a basis for a recovery action.
0x80040901 "WMI: Put property failed"
0x80040902 "WMI: No class object"
0x80040903 "WMI: Failed to create class"
0x80040904 "WMI: Failed to spawn instance of class"
0x80040905 "WMI: Failed to create safe array"
0x80040906 "WMI: Failed to put safe array"
0x80040907 "WMI: Failed to return object to WMI"
0x80040908 "WMI: Get property failed"
0x80040909 "WMI: Unexpected type while getting property"
0x8004090A "WMI: Class not implemented by this provider"
0x8004090B "WMI: Unable to parse WQL statement"
0x8004090C "WMI: Provider only supports WQL"
0x8004090D "WMI: Parameter in context has the wrong type"
0x8004090E "WMI: Error formatting debug log"
0x8004090F "WMI: bad object path"
0x80040910 "WMI: Failed to update setting"
0x80040911 "WMI: Null parameter passed to method"
0x80040912 "Setting value too small."
0x80040913 "Setting value too big."
0x80040914 "Setting not in step"
0x80040915 "String setting is too long"
0x80040916 "Setting is not one of the allowed values"
0x80040917 "WMI: Qualifier not found"
0x80040918 "WMI: Qualifer set not found"
0x80040919 "WMI: Safe array access failed"
0x8004091A "WMI: Unhandled exception"
0x8004091B "WMI: Operation is not supported for this class"
0x8004091C "WMI: Unexpected event class"
0x8004091D "WMI: Bad event data"
0x8004091E "WMI: Operation succeeded with warnings"
0x8004081F "WMI: The NCS2 Service has been stopped."
Copyright© 2004 Intel Corporation. Legal Information