Platform SDK: Windows Management Instrumentation

IWbemQualifierSet::Next

The IWbemQualifierSet::Next method retrieves the next qualifier in an enumeration that started with IWbemQualifierSet::BeginEnumeration. This method is called repeatedly to enumerate all the qualifiers until WBEM_S_NO_MORE_DATA returns. To terminate the enumeration early, call IWbemQualifierSet::EndEnumeration.

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

HRESULT IWbemQualifierSet::Next(
  LONG lFlags,
  BSTR *pstrName,
  VARIANT *pVal,
  LONG *plFlavor
);

Parameters

lFlags
[in] Reserved. It must be zero.
pstrName
[out, OPTIONAL] This parameter receives the name of the qualifier. A new BSTR is always allocated whenever WBEM_S_NO_ERROR returns.

If pstrName is NULL, it is ignored; otherwise, the caller must ensure that this parameter does not point to a valid BSTR on entry, or else there will be a memory leak. Also, the caller must remember to call SysFreeString on the returned string when it is no longer required.

pVal
[out, OPTIONAL] This parameter receives the value for the qualifier. VariantInit is called on the VARIANT by this method. The caller must call VariantClear on this pointer when the value is no longer required. If an error code is returned, the VARIANT pointed to by pVal is left unmodified. This parameter will be ignored if set to NULL.
plFlavor
[out, OPTIONAL] If not NULL, the value pointed to is set to the qualifier flavor. For more information, see Qualifier Flavors.

Return Values

This method returns an HRESULT object that indicates the status of the method call.

Value Meaning
WBEM_E_INVALID_PARAMETER An invalid parameter was specified.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_UNEXPECTED Caller did not call IWbemQualifierSet::BeginEnumeration.
WBEM_S_NO_ERROR The call succeeded.
WBEM_S_NO_MORE_DATA No more qualifiers are left in the enumeration.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP4 or later.
  Windows 95/98: Requires Windows 95 or later (with DCOM).
  Header: Declared in Wbemcli.h; include Wbemidl.h.
  Library: Use Wbemuuid.lib.

See Also

IWbemQualifierSet::BeginEnumeration, IWbemQualifierSet::EndEnumeration, Qualifier Flavors