Interface IWbemEventConsumerProvider¦@¦

Use the IWbemEventConsumerProvider interface to initiate communication with a consumer provider. If you are implementing a permanent event consumer, you also need to implement this interface so that CIMOM can deliver events to the consumers.

 

Methods in Vtable Order

IUnknown Methods Description
QueryInterface_hmm_IWbemContext_QueryInterface Determines if the current object supports a given interface.
AddRef_hmm_IWbemContext_AddRef Increases the object's reference count by 1.
Release_hmm_IWbemContext_Release Decrements the object's reference count and frees the object when the reference count is zero.

 

IWbemEventConsumer

Provider Methods

Description
FindConsumer_hmm_IWbemEventConsumerProvider_FindConsumer Called by CIMOM to retrieve an IwbemUnboundObjectSink for a particular logical consumer.

 

 

‹^# $ K + IWbemEventConsumerProvider::QueryInterface¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWbemEventConsumerProvider::QueryInterface method determines if the object supports a particular COM interface. If it does, the system increases the object's reference count, and the application can use that interface immediately.

HRESULT IWbemEventConsumerProvider::QueryInterface(

[in] REFIID riid,

[out] LPVOID *ppv

);

 

Parameters

riid

The COM interface identifier of the requested interface.

 

obp

Address of a pointer that will be filled with the interface pointer if the query succeeds.

 

 

Return Values

Returns standard COM error codes for QueryInterface. It returns WBEM_S_NO_ERROR if the call succeeds. If the call fails because the requested interface was not supported, the method returns E_NOINTERFACE.

Remarks

When the application no longer needs the interface retrieved by a call to this method, it must call the Release method for that interface to free it. The QueryInterface method allows the extension of objects without interfering with each object's existing or future functionality.

This method is part of the IUnknown interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_iunknown_interface_basics

‹^# $ K + IWbemEventConsumerProvider::AddRef¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWbemEventConsumerProvider::AddRef method increases the object's reference count by 1.

ULONG AddRef( );

 

Parameters

None.

Return Values

Returns the new reference count.

Remarks

When the object is created, its reference count is set to 1. Every time an application obtains an interface to the object or calls the AddRef method, the object's reference count is increased by 1. Use the Release_hmm_IWbemEventConsumerProvider_Release method to decrease the object's reference count by 1.

This method is part of the IUnknown interface inherited by the object. For a complete discussion of IUnknown methods, see IUnknown Programming Basics.

For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_iunknown_interface_basics

‹^# $ K + IWbemEventConsumerProvider::Release¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWbemEventConsumerProvider::Release method decreases the object's reference count by 1.

ULONG IWbemEventProvider::Release( );

 

Parameters

None.

Return Values

Returns the new reference count.

Remarks

The object deallocates itself when its reference count reaches zero. Use the AddRef_hmm_IWbemEventConsumerProvider_AddRef method to increase the object's reference count by 1.

This method is part of the IUnknown interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_iunknown_interface_basics

‹^# $ K + IWbemEventConsumerProvider::FindConsumer¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

When CIMOM needs to deliver events to a particular logical consumer, it will call this method so that the consumer provider can locate the associated consumer event sink.

HRESULT IWbemEventConsumerProvider::FindConsumer(

[in] IWbemClassObject *pLogicalConsumer,

 

[out] IWbemUnboundObjectSink *ppConsumer

);

 

Parameters

pLogicalConsumer

A pointer to the logical consumer object to which the event objects are to be delivered.

 

ppConsumer

Returns an event object sink to CIMOM. CIMOM will AddRef this pointer and deliver the events associated with the logical consumer to this sink. Eventually, after a suitable timeout, CIMOM will Release the pointer.

 

 

Return Values

WBEM_E_FAILED The provider failed internally, and it cannot accept future requests.
WBEM_E_INVALID_PARAMETER One or more parameters was not valid.
WBEM_E_NOT_FOUND The provider was not able to locate or correlate the logical consumer internally, and it failed to return a sink.
WBEM_S_NO_ERROR The provider succeeded and returned a sink to CIMOM.

 

 

Remarks

CIMOM delivers events in the form of IWbemClassObjects_hmm_IWbemClassObject to logical consumers registered within the schema. This interface is implemented by an event consumer provider to provide an event sink to CIMOM whenever events need to be delivered to the logical consumer.

CIMOM knows the logical consumer object and has the event objects ready for delivery. It then calls FindConsumer.The consumer provider must create an event sink object (a pointer to IWbemUnboundObjectSink_hmm_IWbemUnboundObjectSink), and return the pointer to CIMOM so that the events can be delivered.

Using this technique, a single event consumer provider can handle delivery of events to many different logical consumers by returning different IWbemUnboundObjectSink pointers for each.

See Also

Temporary Event Consumers_hmm_Temporary_Event_Consumers,Permanent Event Consumers