WbemFlagEnum enumeration (wbemdisp.h)

The WbemFlagEnum enumeration defines constants that are used by SWbemServices.ExecQuery, SWbemServices.ExecQueryAsync, SWbemServices.SubclassesOf, and SWbemServices.InstancesOf.

The WMI scripting type library, wbemdisp.tlb, defines these constants. Visual Basic applications can access this library; script languages must use the value of the constant directly, unless they use the Windows Script Host (WSH) XML file format. For more information, see Using the WMI Scripting Type Library.

Syntax

typedef enum WbemFlagEnum {
  wbemFlagReturnImmediately = 0x10,
  wbemFlagReturnWhenComplete = 0,
  wbemFlagBidirectional = 0,
  wbemFlagForwardOnly = 0x20,
  wbemFlagNoErrorObject = 0x40,
  wbemFlagReturnErrorObject = 0,
  wbemFlagSendStatus = 0x80,
  wbemFlagDontSendStatus = 0,
  wbemFlagEnsureLocatable = 0x100,
  wbemFlagDirectRead = 0x200,
  wbemFlagSendOnlySelected = 0,
  wbemFlagUseAmendedQualifiers = 0x20000,
  wbemFlagGetDefault = 0,
  wbemFlagSpawnInstance = 0x1,
  wbemFlagUseCurrentTime = 0x1
} ;

Constants

 
wbemFlagReturnImmediately
Value: 0x10
Causes the call to return immediately.
wbemFlagReturnWhenComplete
Value: 0
Causes this call to block until the call has completed.
wbemFlagBidirectional
Value: 0
Causes WMI to retain pointers to objects of the enumeration until the client releases the enumerator.
wbemFlagForwardOnly
Value: 0x20
Causes a forward-only enumerator to be returned. Use this flag in combination with
wbemFlagReturnImmediately to request semisynchronous access. For more information, see
Calling a Method.

You can only iterate (as in a VBScript For Each statement) through a forward-only enumerator one time. The
memory containing the instances is released by WMI so that the enumerator cannot be rewound. Therefore, the
SWbemObjectSet.Count method cannot be used since
it requires rewinding the enumerator.

Forward-only enumerators are generally much faster and use less
memory than conventional enumerators, but they do not allow calls to
SWbemObject.Clone.
wbemFlagNoErrorObject
Value: 0x40
This flag must not be set, and must be ignored on receipt.
wbemFlagReturnErrorObject
Value: 0
Causes asynchronous calls to return an error object in the event of an error.
wbemFlagSendStatus
Value: 0x80
Causes asynchronous calls to send status updates to the
SWbemSink.OnProgress event handler for your object
sink.
wbemFlagDontSendStatus
Value: 0
Prevents asynchronous calls from sending status updates to the
SWbemSink.OnProgress event handler for your object
sink.
wbemFlagEnsureLocatable
Value: 0x100
wbemFlagDirectRead
Value: 0x200
wbemFlagSendOnlySelected
Value: 0
wbemFlagUseAmendedQualifiers
Value: 0x20000
Causes WMI to return class amendment data along with the base class definition. For more information about
amended qualifiers, see
Localizing WMI Class Information.
wbemFlagGetDefault
Value: 0
wbemFlagSpawnInstance
Value: 0x1
wbemFlagUseCurrentTime
Value: 0x1

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Header wbemdisp.h

See also

Calling a Method

Making a Semisynchronous Call with VBScript

Scripting API Constants