Click to Rate and Give Feedback
MSDN
MSDN Library
WMI Reference
COM API for WMI
COM API for WMI

You can use the WMI Component Object Model (COM) API to write management client applications or create a new WMI provider. The COM API reference provides information for advanced system administrators, as well as developers who are writing client and provider applications.

For more information about writing WMI enterprise management applications, see Creating a WMI Application Using C++. For more information about how to write a WMI provider, see Providing Data to WMI.

Note  WMI only supports C++ development using Microsoft Visual C++ version 6.0 and later development systems. However, you can also use other compilers such as those from Borland and Watcom.

Each of the different WMI objects inherit from an interface ultimately inherited from the IUnknown interface. COM dictates how object implementers, or interfaces, handle tasks such as memory management, parameter management, and multithreading. By conforming to COM, the COM API for WMI ensures that it supports the functionality provided by the interfaces of each WMI object.

WMI is accessed through the following WMI-specific COM interfaces.

InterfaceDescription
IEnumWbemClassObjectEnumerator that works with objects of type IWbemClassObject. It is similar to standard COM enumerators, such as IEnumVariant.
IMofCompilerImplemented by Mofd.dll, this interface provides a COM interface that is used by the MOF compiler and any other applications that compile MOF files.
IUnsecuredApartmentUsed to simplify the process of making asynchronous calls from a client process.
IWbemBackupRestoreBacks up and restores the contents of the WMI repository.
IWbemCallResultUsed for semisynchronous calls of the IWbemServices interface. When making such calls, the called IWbemServices method returns immediately, along with an IWbemCallResult object.
IWbemCausalityAnalysisTracks child requests that are generated from a parent request.
IWbemClassObjectContains and manipulates both class definitions and class object instances. Developers need not implement this interface; WMI provides its implementation.
IWbemConfigureRefresherUsed by client code to add or remove enumerators, objects, and nested refreshers into a refresher.
IWbemContextOptionally used to communicate additional context information to providers when submitting IWbemServices calls to Windows Management.
IWbemDecoupledBasicEventProviderRegisters decoupled providers with WMI.
IWbemDecoupledRegistrarAssociates decoupled providers with WMI. This interface allows a process-hosted provider to define the interoperability lifetime of the interface and coexist with other providers.
IWbemEventConsumerProviderProvides the primary interface for an event consumer provider. Through this interface and the FindConsumer method, an event consumer provider can indicate which event consumers should receive a given event.
IWbemEventProviderUsed to initiate communication with an event provider.
IWbemEventProviderQuerySinkOptionally implemented by event providers who want to know what kinds of event query filters are currently active to optimize performance.
IWbemEventProviderSecurityOptionally implemented by event providers who want to restrict consumer access to their event.
IWbemEventSinkInitiates communication with an event provider using a restricted set of queries. This interface extends IWbemObjectSink, providing new methods dealing with security and performance.
IWbemHiPerfProvider Enables providers to supply refreshable objects and enumerators.
IWbemHiPerfEnumUsed in refresher operations to provide rapid access to enumerations of instance objects.
IWbemLocatorObtains the initial namespace pointer to the IWbemServices interface for WMI on a specific host computer.
IWbemObjectAccessProvides access to the methods and properties of an object. An IWbemObjectAccess object is a container for an instance updated by a refresher.
IWbemObjectSinkUsed to receive both the results of IWbemServices and certain types of event notifications.
IWbemObjectTextSrcUsed to translate IWbemClassObject instances to and from differing text formats.
IWbemPropertyProviderSupports retrieving and updating individual properties in an instance of a WMI class.
IWbemProviderIdentityImplemented by an event provider if the provider registers itself using more than one Name (multiple instances of __Win32Provider) with the same CLSID value. The class provides a mechanism for distinguishing which named provider should be used.
IWbemProviderInitUsed to initialize providers.
IWbemProviderInitSinkImplemented by WMI and called by providers to report initialization status.
IWbemQualifierSetActs as a container for the entire set of named qualifiers for a single property or entire object (a class or instance).
IWbemQueryProvides an entry point through which a WMI Query Language (WQL) query can be parsed.
IWbemRefresherProvides an entry point through which refreshable objects such as enumerators or refresher objects, can be refreshed.
IWbemServicesUsed by clients and providers to access WMI services. The interface is implemented only by WMI and is the primary WMI interface.
IWbemStatusCodeTextExtracts text string descriptions of error codes or the name of the subsystem where the error occurred.
IWbemUnboundObjectSinkImplemented by all logical event consumers. It is a simple sink interface that accepts delivery of event objects.

 

Note  Many of the WMI COM functions return numeric error codes that are documented as named constants. These constants are defined in Wbemcli.h in the PSDK WMI\Include folder. For more information, see WMI Return Codes.

For more information about the following topics for COM programming, see Component Development:

  • Interfaces and object design.
  • Implementing IUnknown.
  • Memory management
  • Handling reference counting.

See Also

WMI Reference

Send comments about this topic to Microsoft

Build date: 11/3/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker