IWbemClassObject::Next

[This is preliminary documentation and subject to change.]

The IWbemClassObject::Next method retrieves the next property in an enumeration that was started with IWbemClassObject::BeginEnumeration. This should be called repeatedly to enumerate all the properties until WBEM_S_NO_MORE_DATA is returned. If the enumeration is to be terminated early, then IWbemClassObject::EndEnumeration should be called.

The order of the properties returned during the enumeration is not defined.

HRESULT IWbemClassObject::Next(
  [in] Long lFlags,
  [out, OPTIONAL] BSTR *pbstrName,
  [out, OPTIONAL] VARIANT *pVal,
  [out, OPTIONAL] VARTYPE *pvtType,
  [out, OPTIONAL] Long *plFlavor
);
 

Parameters

lFlags
Reserved. It must be zero.
pbstrName
A new BSTR is allocated to contain the property name. This pointer is set to the address of the new string. To prevent memory leaks in the client process, the caller must call SysFreeString when the name is no longer needed. You can set it to NULL if the name is not required.
pVal
This VARIANT is filled with the value of the qualifier. The method calls VariantInit on this VARIANT. The caller must use VariantClear when the value is no longer needed.

You can set it to NULL if the value is not required. If an error code is returned, the VARIANT pointed to by pVal is left unmodified.

pvtType
Can be NULL. If it is not NULL, it must point to a VARTYPE into which the type of the property is placed. The value of the property can be a VT_NULL VARIANT, in which tcase this parameter would be necessary to determine the actual type of the property.
plFlavor
Can be NULL. If not NULL, the Long value pointed to receives information on the origin of the property as follows:
WBEM_FLAVOR_ORIGIN_LOCAL
The property belongs to the derived-most class.
WBEM_FLAVOR_ORIGIN_PROPAGATED
The property was inherited from a parent class.
WBEM_FLAVOR_ORIGIN_SYSTEM
The property is a standard system property.

Return Values

WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_UNEXPECTED Did not call IWbemClassObject::BeginEnumeration.
WBEM_NO_ERROR Success.
WBEM_S_NO_MORE_DATA No more properties are left in the enumeration.

Remarks

If the underlying type of the property is an object path, a date/time, or another special type, then the returned type does not contain enough information. The caller must examine the CIMTYPE qualifier for the specified property, and determine if the property is an object reference, date/time, or another special type.

This method also returns system properties.

See Also

IWbemClassObject::BeginEnumeration, IWbemClassObject::EndEnumeration, IWbemClassObject::Get, System Properties