Szerkesztés

Megosztás a következőn keresztül:


Registering a Method Provider

To create a WMI method provider you must register the __Win32Provider instance that represents your provider using an instance of __MethodProviderRegistration. After creating an instance of __Win32Provider, you must register that provider with WMI. As a COM object, your provider must register with the operating system and WMI. The following procedure assumes that you have already implemented the registration process as described in Registering a Provider.

The following procedure describes how to register a method provider.

To register a method provider

  1. Create an instance of the __Win32Provider class that describes the provider.

    The __MethodProviderRegistration system class inherits many properties from the __ObjectProviderRegistration parent class, However, the only property relevant for a method provider is the object path to the __Win32Provider instance.

  2. Create an instance of the __MethodProviderRegistration class that describes the feature set of the provider.

    Be sure to tag the class with both the Dynamic and Provider qualifiers. The Dynamic qualifier signals that WMI should use a provider to retrieve the class instances. The Provider qualifier specifies the name of the provider that WMI should use.

The following code example describes how to register a method provider.

  instance of __Win32Provider as $P
  {
    Name    = "MethProvider" ;
    ClsId   = "{E30EC6A0-23CF-11d1-8FDE-0000F804AA5C}" ;
  };    

  instance of __MethodProviderRegistration
  {
    Provider = $P;
  };