IWbemClassObject::BeginEnumeration method

The IWbemClassObject::BeginEnumeration method resets an enumeration back to the beginning of the enumeration. The caller must call this method prior to the first call to IWbemClassObject::Next to enumerate all of the properties on an object. The order in which properties are enumerated is guaranteed to be invariant for a given instance of IWbemClassObject.

Syntax


HRESULT BeginEnumeration(
  [in]  LONG lEnumFlags
);

Parameters

lEnumFlags [in]

Combination of flags described in Remarks.

Return value

This method returns an HRESULT indicating the status of the method call. The following table lists the value contained within an HRESULT.

Return codeDescription
WBEM_E_INVALID_PARAMETER

The specified combination of flags was invalid or an invalid parameter was specified.

WBEM_E_UNEXPECTED

A second call was made to IWbemClassObject::BeginEnumeration without an intervening call to IWbemClassObject::EndEnumeration.

WBEM_E_OUT_OF_MEMORY

There is not enough memory to begin a new enumeration.

WBEM_S_NO_ERROR

The call succeeded.

 

Remarks

You can control the properties included in the enumeration by specifying a combination of the following flags. You can combine one flag from each group with any flag from any other group. However, flags from the same group are mutually exclusive.

GROUP 1

WBEM_FLAG_KEYS_ONLY

Only include properties that constitute the key.

WBEM_FLAG_REFS_ONLY

Only include properties that are object references.

GROUP 2

WBEM_FLAG_SYSTEM_ONLY

Limit the enumeration to system properties only.

WBEM_FLAG_NONSYSTEM_ONLY

Exclude system properties from the enumeration. Includes local and propagated properties.

For classes:
WBEM_FLAG_CLASS_OVERRIDES_ONLY

For classes only. Only properties returned are those properties overridden in the class definition. Overridden properties are those that were defined in a base class, but had either their default value set or a qualifier defined in the current class.

WBEM_FLAG_CLASS_LOCAL_AND_OVERRIDES

For classes only. If this flag is specified, enumerated properties will be those overridden in the current class definition (as in WBEM_FLAG_CLASS_OVERRIDES_ONLY) as well as new properties defined in the current class definition.

WBEM_MASK_CLASS_CONDITION

For classes only. Not a flag - this is just a mask to apply against a flags variable to check if either WBEM_FLAG_CLASS_OVERRIDES_ONLY or WBEM_FLAG_CLASS_LOCAL_AND_OVERRIDES is set.

WBEM_FLAG_LOCAL_ONLY

For classes only. Only include properties that are defined or modified in the class itself.

WBEM_FLAG_PROPAGATED_ONLY

For classes only. Only include properties that are inherited from parent classes.

For instances:
WBEM_FLAG_LOCAL_ONLY

For instances only. Only include properties that are overridden in the instance.

WBEM_FLAG_PROPAGATED_ONLY

For instances only. Only include properties that are inherited from the parent class, but not overridden (that is, value or qualifiers have not been changed).

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows XP

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::EndEnumeration
IWbemClassObject::Next

 

 

Show:
© 2014 Microsoft