IWbemClassObject::Next method

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 *pstrName,
  [out]            VARIANT *pVal,
  [out, optional]  CIMTYPE *pvtType,
  [out, optional]  LONG *plFlavor
);

Parameters

lFlags [in]

Reserved. This parameter must be 0.

pstrName [out]

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.

pVal [out]

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.

pvtType [out, optional]

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.

plFlavor [out, optional]

Can be NULL. If not NULL, the LONG value pointed to receives information on the origin of the property as follows:

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.

WBEM_FLAVOR_ORIGIN_LOCAL

The property belongs to the derived-most class.

For instances:
WBEM_FLAVOR_ORIGIN_PROPAGATED

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

WBEM_FLAVOR_ORIGIN_LOCAL

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

Return value

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

Return codeDescription
WBEM_E_FAILED

An unspecified error has occurred.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_E_UNEXPECTED

Did not call IWbemClassObject::BeginEnumeration.

WBEM_S_NO_ERROR

The call succeeded.

WBEM_S_NO_MORE_DATA

No more properties are left in the enumeration.

WBEM_E_TRANSPORT_FAILURE

This indicates the failure of the remote procedure call (RPC) link between the current process and Windows Management.

 

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

CIMWin32.dll;
Esscli.dll;
Evntrprv.dll;
Fastprox.dll;
Framedyn.dll;
Krnlprov.dll;
Ncprov.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipiprt.dll

See also

IWbemClassObject
WMI System Properties
IWbemClassObject::BeginEnumeration
IWbemClassObject::EndEnumeration
IWbemClassObject::Get

 

 

Show:
© 2014 Microsoft