[This is preliminary documentation and subject to change.]
The DWbemContext interface sends additional information to providers when submitting DIWbemServices calls to CIMOM. All primary calls in DIWbemServices take an optional parameter that can be an object of this type.
In many cases, dynamic providers need more information than is specified in the normal parameters of an DIWbemServices method. For example, to manipulate any CIM schema objects it provides, a provider may need to know an Simple Network Management Protocol (SNMP) Community name or an Structured Query Language (SQL) database and table name. A client can add this information to an DWbemContext object, and send the DWbemContext object along with the call as one of the parameters.
Note It is very important that providers make as little use of this mechanism as possible. Preferably, providers would never use it. If a provider requires a large amount of highly specific context information to respond to a request, all clients must be coded to provide this information. This mechanism can break the uniform access model that is the basis of WBEM. Nevertheless, in some situations you will not be able to avoid it. Therefore, this mechanism allows you to access such providers, if necessary.
When you create an DWbemContext object, this object is a simple container of named values. You can access the methods to fill in any context information required by a dynamic provider. After you call one of the DIWbemServices methods, you can reuse the DWbemContext object for another call.
The underlying provider determines the information contained in an DWbemContext object. CIMOM makes no use of the information, but simply forwards it to the provider. Providers must publish the context information they require to service requests.
BeginEnumeration | Begins an enumeration of all context values in the DWbemContext object. |
Clone | Makes a complete copy of the current DWbemContext object. |
DeleteAll | Removes all context values, making the DWbemContext object empty. |
DeleteValue | Removes the specified context value. |
EndEnumeration | Ends an enumeration begun with BeginEnumeration and Next. |
GetNames | Gets the names of all of the context values available. |
GetValue | Gets the specified context value by name. |
Next | Gets the next value in an enumeration of all context values beginning with BeginEnumeration. |
SetValue | Sets a specific named context value. |