Muokkaa

Jaa


Implementing an instance provider primary interface

An instance provider uses the asynchronous methods of IWbemServices as the primary interface to WMI. By implementing only the methods that fulfill the needs of your instance provider, you can reduce the amount of resources you spend coding. However, by implementing methods reserved for other types of providers, you can reduce the number of providers you write.

Because it is also used by applications and providers to request services of WMI, IWbemServices contains many methods that are irrelevant to an instance provider. The following table lists the IWbemServices methods that you can implement for an instance provider.

Method Feature
GetObjectAsync Retrieval
PutInstanceAsync Modification
DeleteInstanceAsync Deletion
CreateInstanceEnumAsync Enumeration
ExecQueryAsync Query processing

 

For methods that you do not use, your provider can supply a stub implementation that returns WBEM_E_PROVIDER_NOT_CAPABLE. This includes all IWbemServices methods not listed in the above table.

A single provider can act simultaneously as a class, instance, and method provider by proper registration and implementation of all relevant methods. For more information, see Writing a Class Provider and Writing a Method Provider.