WMI Error Constants
If an error occurs, WMI returns an error code as an HRESULT value. These codes may be returned by scripts, C++ applications, or Wmic.
Note If WMI returns error messages, be aware that they may not indicate problems in the WMI service or in WMI providers. Failures can originate in other parts of the operating system and emerge as errors through WMI. Under any circumstances, do not delete the WMI repository as a first action because deleting the repository can cause damage to the system or to installed applications.
To obtain more information about the source of the problem, you can download and run the WMI Diagnosis Utility diagnostic command line tool. This tool produces a report that can usually isolate the source of the problem and provide instructions on how to fix it. The report also aids Microsoft support services in assisting you. You can download the WMI Diagnosis Utility here.
Some methods in WMI classes can return system and network error codes (64 for example). You can check the definition of these types of error codes by using the net helpmsg command in the command prompt window. For example, the command net helpmsg 64 returns the message: The specified network name is no longer available.
The following table lists some common ranges of errors.
Term | Description |
---|---|
0x800410xx - 0x800440 | Errors that originate in WMI itself. A specific WMI operation failed because of
|
0x8007xxx | Errors originating in the core operating system. WMI may return this type of error because of an external failure, for example, DCOM security failure. |
0x80040xxx | Errors originating in DCOM. For example, the DCOM configuration for operations to a remote computer may be incorrect. |
0x80005xxx | Error originating from ADSI (Active Directory Service Interfaces) or LDAP (Lightweight Directory Access Protocol), for example, an Active Directory access failure when using the WMI Active Directory providers. |
Some methods in WMI classes can return system and network error codes (64 for example). You can check the definition of these types of error codes by using the net helpmsg command in the command prompt window. For example, the command net helpmsg 64 returns the message: The specified network name is no longer available. In C++, you can call FormatMessage and specify C:/Windows/System32/wbem/wmiutils.dll as the message module.
Windows 2000, Windows NT 4.0, and Windows Me/98/95: Use C:/Winnt/System32/wbem/wbemcomn.dll as the message module.
Constant/value | Description |
---|---|
| Call failed. |
| Object cannot be found. |
| Current user does not have permission to perform the action. |
| Provider has failed at some time other than during initialization. |
| Type mismatch occurred. |
| Not enough memory for the operation. |
| The IWbemContext object is not valid. |
| One of the parameters to the call is not correct. |
| Resource, typically a remote server, is not currently available. |
| Internal, critical, and unexpected error occurred. Report the error to Microsoft Technical Support. |
| One or more network packets were corrupted during a remote session. |
| Feature or operation is not supported. |
| Parent class specified is not valid. |
| Namespace specified cannot be found. |
| Specified instance is not valid. |
| Specified class is not valid. |
| Provider referenced in the schema does not have a corresponding registration. |
| Provider referenced in the schema has an incorrect or incomplete registration. This error may be caused by many conditions, including the following:
|
| COM cannot locate a provider referenced in the schema. This error may be caused by many conditions, including the following:
|
| Component, such as a provider, failed to initialize for internal reasons. |
| Networking error that prevents normal operation has occurred. |
| Requested operation is not valid. This error usually applies to invalid attempts to delete classes or properties. |
| Query was not syntactically valid. |
| Requested query language is not supported. |
| In a put operation, the wbemChangeFlagCreateOnly flag was specified, but the instance already exists. |
| Not possible to perform the add operation on this qualifier because the owning object does not permit overrides. |
| User attempted to delete a qualifier that was not owned. The qualifier was inherited from a parent class. |
| User attempted to delete a property that was not owned. The property was inherited from a parent class. |
| Client made an unexpected and illegal sequence of calls, such as calling EndEnumeration before calling BeginEnumeration. |
| User requested an illegal operation, such as spawning a class from an instance. |
| Illegal attempt to specify a key qualifier on a property that cannot be a key. The keys are specified in the class definition for an object and cannot be altered on a per-instance basis. |
| Current object is not a valid class definition. Either it is incomplete or it has not been registered with WMI using SWbemObject.Put_. |
| Query is syntactically not valid. |
| Reserved for future use. |
| An attempt was made to modify a read-only property. |
| Provider cannot perform the requested operation. This can include a query that is too complex, retrieving an instance, creating or updating a class, deleting a class, or enumerating a class. |
| Attempt was made to make a change that invalidates a subclass. |
| Attempt was made to delete or modify a class that has instances. |
| Reserved for future use. |
| Value of Nothing/NULL was specified for a property that must have a value, such as one that is marked by a Key, Indexed, or Not_Null qualifier. |
| Variant value for a qualifier was provided that is not a legal qualifier type. |
| CIM type specified for a property is not valid. |
| Request was made with an out-of-range value or it is incompatible with the type. |
| Illegal attempt was made to make a class singleton, such as when the class is derived from a non-singleton class. |
| CIM type specified is invalid. |
| Requested method is not available. |
| Parameters provided for the method are not valid. |
| There was an attempt to get qualifiers on a system property. |
| Property type is not recognized. |
| Asynchronous process has been canceled internally or by the user. Note that due to the timing and nature of the asynchronous operation, the operation may not have been truly canceled. |
| User has requested an operation while WMI is in the process of shutting down. |
| Attempt was made to reuse an existing method name from a parent class and the signatures do not match. |
| One or more parameter values, such as a query text, is too complex or unsupported. WMI is therefore requested to retry the operation with simpler parameters. |
| Parameter was missing from the method call. |
| Method parameter has an invalid ID qualifier. |
| One or more of the method parameters have ID qualifiers that are out of sequence. |
| Return value for a method has an ID qualifier. |
| Specified object path was not valid. |
| Disk is out of space or the 4 GB limit on WMI repository (CIM repository) size is reached.
|
| Supplied buffer was too small to hold all of the objects in the enumerator or to read a string property. |
| Provider does not support the requested put operation. |
| Object with an incorrect type or version was encountered during marshaling. |
| Packet with an incorrect type or version was encountered during marshaling. |
| Packet has an unsupported version. |
| Packet appears to be corrupt. |
| Attempt was made to mismatch qualifiers, such as putting [key] on an object instead of a property. |
| Duplicate parameter was declared in a CIM method. |
| Reserved for future use. |
| Call to IWbemObjectSink::Indicate has failed. The provider can refire the event. |
| Specified qualifier flavor was invalid. |
| Attempt was made to create a reference that is circular (for example, deriving a class from itself). |
| Specified class is not supported. |
| Attempt was made to change a key when instances or subclasses are already using the key. |
| An attempt was made to change an index when instances or subclasses are already using the index. |
| Attempt was made to create more properties than the current version of the class supports. |
| Property was redefined with a conflicting type in a derived class. |
| Attempt was made in a derived class to override a qualifier that cannot be overridden. |
| Method was re-declared with a conflicting signature in a derived class. |
| Attempt was made to execute a method not marked with [implemented] in any relevant class. |
| Attempt was made to execute a method marked with [disabled]. |
| Refresher is busy with another operation. |
| Filtering query is syntactically invalid. |
| The FROM clause of a filtering query references a class that is not an event class (not derived from __Event). |
| A GROUP BY clause was used without the corresponding GROUP WITHIN clause. |
| A GROUP BY clause was used. Aggregation on all properties is not supported. |
| Dot notation was used on a property that is not an embedded object. |
| A GROUP BY clause references a property that is an embedded object without using dot notation. |
| Event provider registration query (__EventProviderRegistration) did not specify the classes for which events were provided. |
| Request was made to back up or restore the repository while it was in use by WinMgmt.exe, or by the SVCHOST process that contains the WMI service. |
| Asynchronous delivery queue overflowed from the event consumer being too slow. |
| Operation failed because the client did not have the necessary security privilege. |
| Operator is invalid for this property type. |
| User specified a username/password/authority on a local connection. The user must use a blank username/password and rely on default security. |
| Class was made abstract when its parent class is not abstract. |
| Amended object was written without the WBEM_FLAG_USE_AMENDED_QUALIFIERS flag being specified. |
| Client did not retrieve objects quickly enough from an enumeration. This constant is returned when a client creates an enumeration object, but does not retrieve objects from the enumerator in a timely fashion, causing the enumerator's object caches to back up.
|
| Null security descriptor was used.
|
| Operation timed out.
|
| Association is not valid.
|
| Operation was ambiguous.
|
| WMI is taking up too much memory. This can be caused by low memory availability or excessive memory consumption by WMI.
|
| Operation resulted in a transaction conflict.
|
| Transaction forced a rollback.
|
| Locale used in the call is not supported.
|
| Object handle is out-of-date.
|
| Connection to the SQL database failed.
|
| Handle request was invalid.
|
| Property name contains more than 255 characters.
|
| Class name contains more than 255 characters.
|
| Method name contains more than 255 characters.
|
| Qualifier name contains more than 255 characters.
|
| The SQL command must be rerun because there is a deadlock in SQL. This can be returned only when data is being stored in an SQL database.
|
| Database version does not match the version that the repository driver understands.
|
| WMI cannot execute the delete operation because the provider does not allow it.
|
| WMI cannot execute the put operation because the provider does not allow it.
|
| Specified locale identifier was invalid for the operation.
|
| Provider is suspended.
|
| Object must be written to the WMI repository and retrieved again before the requested operation can succeed. This constant is returned when an object must be committed and retrieved to see the property value.
|
| Operation cannot be completed; no schema is available.
|
| Provider cannot be registered because it is already registered.
|
| Provider was not registered.
|
| atal transport error occurred.
|
| User attempted to set a computer name or domain without an encrypted connection.
|
| A provider failed to report results within the specified timeout.
|
| User attempted to put an instance with no defined key.
|
| User attempted to register a provider instance but the COM server for the provider instance was unloaded.
|
| Provider registration overlaps with the system event domain. |
| A WITHIN clause was not used in this query. |
| This computer does not have the necessary domain permissions to support the security functions that relate to the created subscription instance. Contact the Domain Administrator to get this computer added to the Windows Authorization Access Group. |
| Reserved for future use. |
| Reserved for future use. |
| Expected a qualifier name. |
| Expected semicolon or '='. |
| Expected an opening brace. |
| Missing closing brace or an illegal array element. |
| Expected a closing bracket. |
| Expected closing parenthesis. |
| Numeric value out of range or strings without quotes. |
| Expected a type identifier. |
| Expected an open parenthesis. |
| Unexpected token in the file. |
| Unrecognized or unsupported type identifier. |
| Expected property or method name. |
| Typedefs and enumerated types are not supported. |
| Only a reference to a class object can have an alias value. |
| Unexpected array initialization. Arrays must be declared with []. |
| Invalid namespace path syntax. |
| Duplicate amendment specifiers. |
| #pragma must be followed by a valid keyword. |
| Invalid namespace path syntax. |
| Unexpected character in class name must be an identifier. |
| The value specified cannot be made into the appropriate type. |
| Dollar sign must be followed by an alias name as an identifier. |
| Invalid class declaration. |
| The instance declaration is invalid. It must start with "instance of" |
| Expected dollar sign. An alias in the form "$name" must follow the "as" keyword. |
| "CIMTYPE" qualifier cannot be specified directly in a MOF file. Use standard type notation. |
| Duplicate property name was found in the MOF. |
| Invalid namespace syntax. References to other servers are not allowed. |
| Value out of range. |
| The file is not a valid text MOF file or binary MOF file. |
| Embedded objects cannot be aliases. |
| NULL elements in an array are not supported. |
| Qualifier was used more than once on the object. |
| Expected a flavor type such as ToInstance, ToSubClass, EnableOverride, or DisableOverride. |
| Combining EnableOverride and DisableOverride on same qualifier is not legal. |
| An alias cannot be used twice. |
| Combining Restricted, and ToInstance or ToSubClass is not legal. |
| Methods cannot return array values. |
| Arguments must have an In or Out qualifier. |
| Invalid flags syntax. |
| The final brace and semi-colon for a class are missing. |
| A CIM version 2.2 feature is not supported for a qualifier value. |
| The CIM version 2.2 data type is not supported. |
| Invalid delete instance syntax. It should be |
| Invalid qualifier syntax. It should be |
| The qualifier is used outside of its scope. |
| Error creating temporary file. The temporary file is an intermediate stage in the MOF compilation. |
| A file included in the MOF by the preprocessor command #include is invalid. |
| The syntax for the preprocessor commands #pragma deleteinstance or #pragma deleteclass is not valid. |