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.
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.
Used for semisynchronous calls of the IWbemServices interface. When making such calls, the called IWbemServices method returns immediately, along with an IWbemCallResult object.
Contains and manipulates both class definitions and class object instances. Developers need not implement this interface; WMI provides its implementation.
Associates decoupled providers with WMI. This interface allows a process-hosted provider to define the interoperability lifetime of the interface and coexist with other providers.
Provides 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.
Initiates communication with an event provider using a restricted set of queries. This interface extends IWbemObjectSink, providing new methods dealing with security and performance.
Implemented 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.
Implemented 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:
This learning path covers Windows Management Instrumentation (WMI) and Common Information Model (CIM). These technologies help to access information about a computer. Additionally, both technologies provide local and remote access to management information from the operating system, computer hardware, and installed software.