<span style=color:#FF0000>
[This is preliminary documentation and subject to change.]</span>Use the IWbemEventProvider interface to initiate communication with an event provider. CIMOM calls the providers implementation of this interface when a consumer has indicated interest in receiving events generated by the provider.
Methods in Vtable Order
Iunknown Methods | Description |
QueryInterface_hmm_IWbemEventProvider_QueryInterface | Determines if the current object supports a given interface. |
AddRef_hmm_IWbemEventProvider_AddRef | Increases the object's reference count by 1. |
Release_hmm_IWbemEventProvider_Release | Decrements the object's reference count, and frees the object when the reference count is zero. |
IWbemEventProvider Methods | Description |
ProvideEvents_hmm_IWbemEventProvider_ProvideEvents | Called by CIMOM to command the provider to start delivering its events to CIMOM. |
^# $ K + IWbemEventProvider::QueryInterface¦@¦
<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>
The IWbemEventProvider::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 IWbemEventProvider::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 + IWbemEventProvider::AddRef¦@¦
<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>
The IWbemEventProvider::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_IWbemEventProvider_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 + IWbemEventProvider::Release¦@¦
<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>
The IWbemEventProvider::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_IWbemEventProvider_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 + IWbemEventProvider::ProvideEvents¦@¦
<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>
CIMOM calls this method to signal an event provider to begin delivery of its events.
HRESULT IWbemEventProvider::ProvideEvents(
[in] IWbemObjectSink *pSink,
[in] LONG lFlags
);
Parameters
pSink
A pointer to the object sink to which the provider will deliver its events.
lFlags
Reserved. It must be zero.
Return Values
WBEM_E_FAILED | The provider failed internally, and it cannot accept future requests. |
WBEM_S_NO_ERROR | The provider received the sink, and it will begin delivery of events. |
Remarks
CIMOM calls this method to activate the provider. CIMOM gives an IWbemObjectSink pointer to the event provider. The provider must call theAddRef method using this pointer to increment the reference count , and then return from the call.
Typically, the provider will create an independent thread, and deliver the events as they occur to the provided sink interface.
The provider is not permitted to block this call for more than a few seconds, but it must return as quickly as possible to CIMOM.
See Also
Constructing Event Providers