CWbemProviderGlue::GetAllInstances method

[The CWbemProviderGlue 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 GetAllInstances method retrieves a list of instances returned by a specific class.


HRESULT GetAllInstances(
  LPCWSTR                          pszClassName,
  TRefPointerCollection<CInstance> *pList,
  LPCWSTR                          pszNamespace,
  MethodContext                    *pMethodContext



Name of class for which a list of instances should be returned.


Linked list of instances supported by the provider specified by pszClassName.


Namespace of the provider specified by pszClassName. This parameter can be NULL to indicate the default namespace, which is "Root\CIMv2".


Pointer to the current context. A context must be provided to prevent deadlocks. Either use the context passed into the provider by Provider::EnumerateInstances or Provider::ExecQuery, or else obtain it from the instance using CInstance::GetMethodContext. This parameter must not be NULL.

Return Value

The method returns WBEM_S_NO_ERROR if the operation was successful, WBEM_E_OUT_OF_MEMORY if the operation failed due to lack of memory, or any other HRESULT error code.


The GetAllInstances method allows framework providers to access data from another provider without having to make a WMI API call. Framework providers pass the name of the provider to GetAllInstances, which returns a list of all of the instances that the provider supports.

This method is semantically equivalent to the query SELECT * FROM pszBaseClassName WHERE __Class = pszBaseClassName.


Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header wbemglue.h (include FwCommon.h)
Library FrameDyn.lib
DLL FrameDynOS.dll; FrameDyn.dll