Provider class (provider.h)

[The Provider class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The Provider class is the base class for the class or classes that the framework provider supports. The Provider class encapsulates implementations of the methods of IWbemServices and includes several helper functions. A framework provider overrides one of the methods of the Provider class for each feature that it supports. For example, a provider that supports query processing overrides the Provider::ExecQuery method.

An instance of the Provider class is created for each WMI class that has a framework provider.

Provider has these types of members:

Method Description
Commit Returns the current instance to WMI.
CreateNewInstance Allocates a new CInstance object and returns a pointer to it.
DeleteInstance Deletes an instance. Called by WMI.
EnumerateInstances Retrieves all instances of a framework provider's class. Called by WMI.
ExecMethod Invokes a method on a class or instance. Called by WMI.
ExecQuery Processes a WMI Query Language (WQL) query. Called by WMI.
Flush Called by the provider framework to delete all unnecessary memory in use by the provider.
GetLocalComputerName Returns a constant reference to the computer name in CHString format.
GetLocalInstancePath Attempts to build a full object path to a specified instance.
GetObject Retrieves an instance of a class. Called by WMI.
GetProviderName Retrieves the name of the provider.
MakeLocalPath Builds a full instance path from a relative path.
PutInstance Updates an instance. Called by WMI.
SetCreationClassName Sets the CreationClassName string property of the given instance to the name of this provider.
ValidateDeletionFlags Determines whether a set of flags is valid for a delete operation.
ValidateEnumerationFlags Determines whether a set of flags is valid for an enumeration.
ValidateFlags Determines whether a set of flags is valid.
ValidateGetObjFlags Determines whether a set of flags is valid for an instance retrieval operation.
ValidateMethodFlags Determines whether a set of flags is valid for an execute method operation.
ValidatePutInstanceFlags Determines whether a set of flags is valid for an instance update operation.
ValidateQueryFlags Determines whether a set of flags is valid for a query operation.

Inheritance

The Provider class implements CThreadBase.

Methods

The Provider class has these methods.

 
Provider::~Provider

The Provider::~Provider function is a destructor for the Provider class.
Provider::Commit

The Commit method is used to send an instance to WMI. This method is a helper function and should not be overridden.
Provider::CreateNewInstance

The CreateNewInstance method allocates a new CInstance object and returns a pointer to it.
Provider::DeleteInstance

The DeleteInstance method is called by WMI to delete an instance. (overload 2/2)
Provider::DeleteInstance

The DeleteInstance method is called by WMI to delete an instance. (overload 1/2)
Provider::EnumerateInstances

The EnumerateInstances method is called by WMI to retrieve all instances of a framework provider's class.
Provider::ExecMethod

The ExecMethod method is called by WMI to invoke a method on a class or instance. (overload 1/2)
Provider::ExecMethod

The ExecMethod method is called by WMI to invoke a method on a class or instance. (overload 2/2)
Provider::ExecQuery

The ExecQuery method is called by WMI to process a WMI Query Language (WQL) query.
Provider::Flush

The Flush method is called by the provider framework to delete all unnecessary memory in use by the provider.
Provider::GetLocalComputerName

The GetLocalComputerName method returns a constant reference to the computer name in CHString format.
Provider::GetLocalInstancePath

The GetLocalInstancePath method attempts to build a full object path to a specified instance. This method is a helper function and should not be overridden.
Provider::GetNamespace

The GetNamespace method returns a constant reference to the namespace name in CHString format. The name returned is the second parameter originally given to the provider constructor.
Provider::GetObject

The GetObject method is called by WMI to retrieve an instance of a class. (overload 1/3)
Provider::GetObject

The GetObject method is called by WMI to retrieve an instance of a class. (overload 2/3)
Provider::GetObject

The GetObject method is called by WMI to retrieve an instance of a class. (overload 3/3)
Provider::GetProviderName

The GetProviderName method retrieves the name of the class used in the constructor of the provider.
Provider::MakeLocalPath

The MakeLocalPath method builds a full instance path from a relative path.
Provider::Provider

The Provider method creates an instance of a provider. This method is part of the WMI Provider Framework.
Provider::PutInstance

The PutInstance method updates an instance. (overload 2/2)
Provider::PutInstance

The PutInstance method updates an instance. (overload 1/2)
Provider::SetCreationClassName

The SetCreationClassName method sets the CreationClassName string property, if any, of the given instance to the name of this provider.
Provider::ValidateDeletionFlags

The ValidateDeletionFlags method determines whether a set of flags is valid for a delete operation.
Provider::ValidateEnumerationFlags

The ValidateEnumerationFlags method determines whether a set of flags is valid for an enumeration.
Provider::ValidateFlags

The ValidateFlags method determines whether a set of flags is valid.
Provider::ValidateGetObjFlags

The ValidateGetObjFlags method determines whether a set of flags is valid for an instance retrieval operation.
Provider::ValidateMethodFlags

The ValidateMethodFlags method determines whether a set of flags is valid for an execute method operation.
Provider::ValidatePutInstanceFlags

The ValidatePutInstanceFlags method determines whether a set of flags is valid for an instance update operation.
Provider::ValidateQueryFlags

The ValidateQueryFlags method determines whether a set of flags is valid for a query operation.

Remarks

The destructor for this class is Provider::~Provider.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header provider.h (include FwCommon.h)