WindowsXP/admin/wmi/wbem/winmgmt/specs/html/interface_iwbemeventconsumerprov.htm
2025-04-27 07:49:33 -04:00

321 lines
14 KiB
HTML

<html>
<head>
<title>Interface IWbemEventConsumerProvider</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<p>&nbsp;<font FACE="Arial Narrow" SIZE="6" COLOR="#800000"></p>
<p></font><b><font FACE="Arial Narrow" SIZE="6">Interface IWbemEventConsumerProvider</font><font
FACE="Arial Narrow" SIZE="1" COLOR="#800000">¦@¦</font></b><font SIZE="2"
COLOR="#ff00ff"></p>
</font><font FACE="Arial" SIZE="2">
<p>Use the <b>IWbemEventConsumerProvider</b> 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. </p>
<p>&nbsp;<b></p>
<p>Methods in Vtable Order</b></font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>IUnknown Methods</b></font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>Description</b></font></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>QueryInterface</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemContext_QueryInterface</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Determines if the current object
supports a given interface.</font></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>AddRef</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemContext_AddRef</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Increases the object's reference
count by 1.</font></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>Release</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemContext_Release</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Decrements the object's reference
count and frees the object when the reference count is zero.</font></td>
</tr>
</table>
<p>&nbsp;</p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td VALIGN="TOP" COLSPAN="2"></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>IWbemEventConsumer<p>Provider
Methods</b></font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>Description</b></font></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>FindConsumer</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemEventConsumerProvider_FindConsumer</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Called by CIMOM to retrieve an
IwbemUnboundObjectSink for a particular logical consumer.</font></td>
</tr>
</table>
<p>&nbsp;<font FACE="Arial" SIZE="1"></p>
<p>&nbsp;</font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
<p>&#139;^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
FACE="Arial Narrow" SIZE="5" COLOR="#800000">&#155;</font><b><font FACE="Arial Narrow"
SIZE="5">IWbemEventConsumerProvider::QueryInterface</font><font FACE="Arial Narrow"
SIZE="1" COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
<p>&lt;span style=color:#FF0000&gt;</font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff">&lt;/span&gt;</font><font
FACE="Arial" SIZE="2"> </p>
<p>The <b>IWbemEventConsumerProvider::QueryInterface</b> 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.</font><font
FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>HRESULT IWbemEventConsumerProvider::QueryInterface(</p>
<p>[in] REFIID</b><i> riid</i><b>,</p>
<p>[out] LPVOID</b><i> *ppv</i><b></p>
<p>);</b></p>
<p></font><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Parameters</b></font><font FACE="Arial" SIZE="2"><i></p>
<p>riid</p>
<blockquote>
</i><p>The COM interface identifier of the requested interface.</p>
</blockquote>
<p>&nbsp;<i></p>
<p>obp</p>
<blockquote>
</i><p>Address of a pointer that will be filled with the interface pointer if the query
succeeds.</p>
</font><font FACE="Arial" SIZE="1"><p></font>&nbsp;</p>
</blockquote>
<p>&nbsp;<font FACE="Arial Narrow"><b></p>
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
<p>Returns standard COM error codes for <b>QueryInterface</b>. 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.</font><font FACE="Arial Narrow"><b></p>
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
<p>When the application no longer needs the interface retrieved by a call to this method,
it must call the <b>Release</b> method for that interface to free it. The <b>QueryInterface</b>
method allows the extension of objects without interfering with each object's existing or
future functionality.</p>
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For more
information about this method, see the COM documentation in the Microsoft Platform SDK.</font><b><font
FACE="Arial Narrow"></p>
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_iunknown_interface_basics</font><font
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
<p>&#139;^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
FACE="Arial Narrow" SIZE="5" COLOR="#800000">&#155;</font><b><font FACE="Arial Narrow"
SIZE="5">IWbemEventConsumerProvider::AddRef</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
<p>&lt;span style=color:#FF0000&gt;</font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff">&lt;/span&gt;</font><font
FACE="Arial" SIZE="2"> </p>
<p>The <b>IWbemEventConsumerProvider::AddRef</b> method increases the object's reference
count by 1.</font><font FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>ULONG AddRef( );</b></p>
<p></font><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Parameters</b></font><font FACE="Arial" SIZE="2"></p>
<p>None.</font><font FACE="Arial Narrow"><b></p>
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
<p>Returns the new reference count.</font><font FACE="Arial Narrow"><b></p>
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
<p>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 <b>AddRef</b> method, the object's
reference count is increased by 1. Use the <u><b>Release</b></u></font><font FACE="Arial"
SIZE="2" COLOR="#800000">_hmm_IWbemEventConsumerProvider_Release</font><font FACE="Arial"
SIZE="2"> method to decrease the object's reference count by 1. </p>
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For a
complete discussion of <b>IUnknown</b> methods, see <b>IUnknown Programming Basics</b>.</p>
<p>For more information about this method, see the COM documentation in the Microsoft
Platform SDK.</font><b><font FACE="Arial Narrow"></p>
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_iunknown_interface_basics</font><font
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
<p>&#139;^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
FACE="Arial Narrow" SIZE="5" COLOR="#800000">&#155;</font><b><font FACE="Arial Narrow"
SIZE="5">IWbemEventConsumerProvider::Release</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
<p>&lt;span style=color:#FF0000&gt;</font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff">&lt;/span&gt;</font><font
FACE="Arial" SIZE="2"> </p>
<p>The <b>IWbemEventConsumerProvider::Release</b> method decreases the object's reference
count by 1.</font><b><font FACE="Lucida Sans Typewriter" SIZE="2"></p>
<p>ULONG IWbemEventProvider::Release( );</p>
<p></font><font FACE="Arial Narrow">&nbsp;</p>
<p>Parameters</font></b><font FACE="Arial" SIZE="2"></p>
<p>None.</font><font FACE="Arial Narrow"><b></p>
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
<p>Returns the new reference count.</font><font FACE="Arial Narrow"><b></p>
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
<p>The object deallocates itself when its reference count reaches zero. Use the <u><b>AddRef</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemEventConsumerProvider_AddRef</font><font
FACE="Arial" SIZE="2"> method to increase the object's reference count by 1.</p>
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For more
information about this method, see the COM documentation in the Microsoft Platform SDK.</font><b><font
FACE="Arial Narrow"></p>
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_iunknown_interface_basics</font><font
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
<p>&#139;^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
FACE="Arial Narrow" SIZE="5" COLOR="#800000">&#155;</font><b><font FACE="Arial Narrow"
SIZE="5">IWbemEventConsumerProvider::FindConsumer</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
<p>&lt;span style=color:#FF0000&gt;</font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff">&lt;/span&gt;</font><font
FACE="Arial" SIZE="2"> </p>
<p>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.</font><font
FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>HRESULT IWbemEventConsumerProvider::FindConsumer(</p>
<p>[in] IWbemClassObject</b><i> *pLogicalConsumer</i>,</p>
<p>&nbsp;<b></p>
<p>[out] IWbemUnboundObjectSink</b><i> *ppConsumer</i><b></p>
<p>);</b></p>
<p></font><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Parameters</b></font><font FACE="Arial" SIZE="2"><i></p>
<p>pLogicalConsumer</p>
<blockquote>
</i><p>A pointer to the logical consumer object to which the event objects are to be
delivered.</p>
</blockquote>
<p>&nbsp;<i></p>
<p>ppConsumer</p>
<blockquote>
</i><p>Returns an event object sink to CIMOM. CIMOM will <i>AddRef </i>this pointer and
deliver the events associated with the logical consumer to this sink. Eventually, after a
suitable timeout, CIMOM will <i>Release</i> the pointer.</p>
</font><font FACE="Arial" SIZE="1"><p></font>&nbsp;</p>
</blockquote>
<p>&nbsp;<font FACE="Arial Narrow"><b></p>
<p>Return Values</b></font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_FAILED</font></td>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The provider failed internally,
and it cannot accept future requests.</font></td>
</tr>
<tr>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_INVALID_PARAMETER</font></td>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">One or more parameters was not
valid.</font></td>
</tr>
<tr>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_NOT_FOUND</font></td>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The provider was not able to
locate or correlate the logical consumer internally, and it failed to return a sink.</font></td>
</tr>
<tr>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_NO_ERROR</font></td>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The provider succeeded and
returned a sink to CIMOM.</font></td>
</tr>
</table>
<p>&nbsp;<font FACE="Arial" SIZE="2"></p>
<p>&nbsp;</font><font FACE="Arial Narrow"><b></p>
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
<p>CIMOM delivers events in the form of <u><b>IWbemClassObjects</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemClassObject</font><font FACE="Arial"
SIZE="2"><b> </b>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. </p>
<p>CIMOM knows the logical consumer object and has the event objects ready for delivery.
It then calls <i>FindConsumer.</i>The consumer provider must create an event sink object
(a pointer to <u><b>IWbemUnboundObjectSink</b></u></font><font FACE="Arial" SIZE="2"
COLOR="#800000">_hmm_IWbemUnboundObjectSink</font><font FACE="Arial" SIZE="2">), and
return the pointer to CIMOM so that the events can be delivered.</p>
<p>Using this technique, a single event consumer provider can handle delivery of events to
many different logical consumers by returning different <b>IWbemUnboundObjectSink </b>pointers
for each.</font><font FACE="Arial Narrow"><b></p>
<p>See Also</b></font><font FACE="Arial" SIZE="2"><u></p>
<p>Temporary Event Consumers</u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_Temporary_Event_Consumers</font><font
FACE="Arial" SIZE="2">,Permanent Event Consumers</font></p>
</body>
</html>