IWbemClassObject::Next method (wbemcli.h)

The IWbemClassObject::Next method retrieves the next property in an enumeration that started with IWbemClassObject::BeginEnumeration. This should be called repeatedly to enumerate all the properties until WBEM_S_NO_MORE_DATA returns. 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.

Syntax

HRESULT Next(
  [in]            long    lFlags,
  [out]           BSTR    *strName,
  [out]           VARIANT *pVal,
  [out, optional] CIMTYPE *pType,
  [out, optional] long    *plFlavor
);

Parameters

[in] lFlags

Reserved. This parameter must be 0.

[out] strName

Receives a new BSTR that contains the property name. To prevent memory leaks in the client process, the caller must call SysFreeString when the name is no longer required. You can set this parameter to NULL if the name is not required.

[out] pVal

This VARIANT is filled with the value of the property. The method calls VariantInit on this VARIANT, so the caller should ensure that the VARIANT is not active prior to the call. The caller must use VariantClear when the value is no longer required.

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

[out, optional] pType

This parameter can be NULL. If it is not NULL, it must point to a CIMTYPE variable (a LONG) into which the type of the property is placed. It is possible that the value of this property can be a VT_NULL VARIANT, in which case it is necessary to determine the actual type of the property.

[out, optional] plFlavor

Can be NULL. If not NULL, the LONG value pointed to receives information on the origin of the property as follows. For more information, see Qualifier Flavors and WBEM_FLAVOR_TYPE.

WBEM_FLAVOR_ORIGIN_SYSTEM

The property is a standard system property.

For classes:

WBEM_FLAVOR_ORIGIN_PROPAGATED

The property was inherited from the parent class.

The property, while inherited from the parent class, has not been modified at the instance level.

WBEM_FLAVOR_ORIGIN_LOCAL

The property belongs to the derived-most class.

The property is modified at the instance level (that is, either a value was supplied or a qualifier was added/modified).

For instances:

Return value

This method returns an HRESULT that indicates the status of the method call. The following list lists the value contained within an HRESULT. For general HRESULT values, see System Error Codes.

Remarks

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

This method also returns system properties.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wbemcli.h (include Wbemidl.h)
Library WbemUuid.lib
DLL CIMWin32.dll; Esscli.dll; Fastprox.dll; FrameDyn.dll; FrameDynOS.dll; Krnlprov.dll; Ncprov.dll; Wbemcore.dll; Wbemess.dll; Wmipiprt.dll

See also

IWbemClassObject

IWbemClassObject::BeginEnumeration

IWbemClassObject::EndEnumeration

IWbemClassObject::Get

WMI System Properties