Skip to content

Latest commit

 

History

History
99 lines (81 loc) · 5.39 KB

nf-provider-provider-enumerateinstances.md

File metadata and controls

99 lines (81 loc) · 5.39 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:provider.Provider.EnumerateInstances
Provider::EnumerateInstances (provider.h)
The EnumerateInstances method is called by WMI to retrieve all instances of a framework provider's class.
?EnumerateInstances@Provider@@MAEJPAVMethodContext@@J@Z
EnumerateInstances
EnumerateInstances method [Windows Management Instrumentation]
EnumerateInstances method [Windows Management Instrumentation]
Provider interface
Provider interface [Windows Management Instrumentation]
EnumerateInstances method
Provider.EnumerateInstances
Provider::EnumerateInstances
_hmm_provider_enumerateinstances
provider/Provider::EnumerateInstances
wmi.provider_enumerateinstances
wmi\provider_enumerateinstances.htm
wmi
9566acb0-d7bf-4d3d-b7da-5cfbce150a2c
12/05/2018
?EnumerateInstances@Provider@@MAEJPAVMethodContext@@J@Z, EnumerateInstances, EnumerateInstances method [Windows Management Instrumentation], EnumerateInstances method [Windows Management Instrumentation],Provider interface, Provider interface [Windows Management Instrumentation],EnumerateInstances method, Provider.EnumerateInstances, Provider::EnumerateInstances, _hmm_provider_enumerateinstances, provider/Provider::EnumerateInstances, wmi.provider_enumerateinstances
provider.h
FwCommon.h
Windows
Windows Vista
Windows Server 2008
FrameDyn.lib
FrameDynOS.dll; FrameDyn.dll
Windows
19H1
Provider::EnumerateInstances
provider/Provider::EnumerateInstances
c++
APIRef
kbSyntax
DllExport
FrameDynOS.dll
FrameDyn.dll
Provider.EnumerateInstances
?EnumerateInstances@Provider@@MAEJPAVMethodContext@@J@Z

Provider::EnumerateInstances

-description

[The Provider class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The EnumerateInstances method is called by WMI to retrieve all instances of a framework provider's class.

-parameters

-param pMethodContext

Pointer to the context object for this call. This value contains any IWbemContext properties specified by the client. Also, this pointer must be used as a parameter to any calls back into WMI.

-param lFlags

Bitmask of flags with information about the EnumerateInstances operation. This is the value specified by the client in the IWbemServices::CreateInstanceEnum method.

The following flags are handled by (and filtered out) by WMI:

  • WBEM_FLAG_DEEP
  • WBEM_FLAG_SHALLOW
  • WBEM_FLAG_RETURN_IMMEDIATELY
  • WBEM_FLAG_FORWARD_ONLY
  • WBEM_FLAG_BIDIRECTIONAL
  • WBEM_FLAG_USE_AMENDED_QUALIFIERS

-returns

The default framework provider implementation of this method returns WBEM_E_PROVIDER_NOT_CAPABLE to the calling method. The IWbemServices::CreateInstanceEnum method lists the most common return values, but you can choose to return any COM return code.

-remarks

It is not an error for EnumerateInstances to return zero instances by instantiating zero CInstance instances and setting the return value to WBEM_S_NO_ERROR.

WMI often calls EnumerateInstances when a client application calls IWbemServices::CreateInstanceEnum, although WMI may call EnumerateInstances in other situations as well. The following is a common way to override EnumerateInstances:

  1. Create an empty instance of your class using Provider::CreateNewInstance.
  2. Populate the properties of the empty instance using the Set methods of the CInstance class, such as CInstance::SetByte or CInstance::SetStringArray.
  3. Send the instance back to the client using CInstance::Commit.
If you are building a method-only provider and do not have any instances, or if enumerating instances of your class would return too many instances, you may decide to support queries that retrieve only specific instances.