Registering the Performance Monitoring Provider

Because the Performance Monitoring Provider is not automatically registered with WMI during installation, management applications wanting to use this provider must complete the registration process. To register the Performance Monitoring provider, applications create instances of the __Win32Provider system class and either __InstanceProviderRegistration or __PropertyProviderRegistration.

To register the Performance Monitoring provider as an instance provider

The MOF compiler, mofcomp.exe, registers a provider with WMI. For more information, see Registering a Provider.

Using mofcomp.exe, compile the following MOF code.

instance of __Win32Provider as $PMPInst
{
    Name  = "PerfProv";
    ClsId = "{f00b4404-f8f1-11ce-a5b6-00aa00680c3f}";
    HostingModel = "NetworkServiceHost"; 
};    

instance of __InstanceProviderRegistration
{
    Provider = $PMPInst;
    SupportsPut = FALSE;
    SupportsGet = TRUE;
    SupportsDelete = FALSE;
    SupportsEnumeration = TRUE;
};

To register the Performance Monitoring provider as a property provider

The Performance Monitoring provider is registered under the name "PerfPropProv".

Create the following instances in MOF code.

instance of __Win32Provider as $PMPProp
{
    Name = "PerfPropProv";
    Clsid = "{72967903-68EC-11d0-B729-00AA0062CBB7}";
};

instance of __PropertyProviderRegistration 
{
    Provider = $PMPProp;
    SupportsGet = TRUE;
    SupportsPut = FALSE;
};

class PropPerf
{
  [KEY] string MyKey;
  real32 Available;
};

[DYNPROPS]
instance of PropPerf
{
  MyKey = "abc";
  [PropertyContext("local|memory|available bytes"), DYNAMIC,
   Provider("PerfPropProv")]
  Available;
};

 

 

Show:
© 2014 Microsoft