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

299 lines
12 KiB
HTML

<html>
<head>
<title>Interface IWbemEventProvider</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<font FACE="Arial Narrow" SIZE="6" COLOR="#800000">
<p></font><b><font FACE="Arial Narrow" SIZE="6">Interface IWbemEventProvider</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>Use the <b>IWbemEventProvider</b> interface to initiate communication with an event
provider. CIMOM calls the provider&#146;s implementation of this interface when a consumer
has indicated interest in receiving events generated by the provider. </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_IWbemEventProvider_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_IWbemEventProvider_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_IWbemEventProvider_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>IWbemEventProvider 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>ProvideEvents</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemEventProvider_ProvideEvents</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2" COLOR="#008000">Called by CIMOM<b>
</b>to command the provider to start delivering its events to CIMOM.</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">IWbemEventProvider::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>IWbemEventProvider::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 IWbemEventProvider::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><i>. </i>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">IWbemEventProvider::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>IWbemEventProvider::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_IWbemEventProvider_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">IWbemEventProvider::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>IWbemEventProvider::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_IWbemEventProvider_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">IWbemEventProvider::ProvideEvents</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>CIMOM calls this method to signal an event provider to begin delivery of its events.</font><font
FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>HRESULT IWbemEventProvider::ProvideEvents(</p>
<p>[in] IWbemObjectSink</b><i> *pSink</i><b>,</p>
<p>[in] LONG </b><i>lFlags</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>pSink</p>
<blockquote>
</i><p>A pointer to the object sink to which the provider will deliver its events.</p>
</blockquote>
<p>&nbsp;<i></p>
<p>lFlags</p>
<blockquote>
</i><p>Reserved. It must be zero.</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_S_NO_ERROR</font></td>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The provider received the sink,
and it will begin delivery of events.</font></td>
</tr>
</table>
<p>&nbsp;<font FACE="Arial" SIZE="1"></p>
<p>&nbsp;</font><font FACE="Arial Narrow"><b></p>
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
<p>CIMOM calls this method to activate the provider. CIMOM gives an <b>IWbemObjectSink </b>pointer
to the event provider. The provider must call the<b>AddRef</b> method using this pointer
to increment the reference count , and then return from the call. </p>
<p>Typically, the provider will create an independent thread, and deliver the events as
they occur to the provided sink interface.</p>
<p>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.</font><b><font FACE="Arial Narrow"></p>
<p>See Also</font><font FACE="Arial" SIZE="2"></p>
<p>Constructing Event Providers</font></b></p>
</body>
</html>