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

587 lines
22 KiB
HTML
Raw Permalink Blame History

<html>
<head>
<title>Interface IWbemObjectSink</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<p><font FACE="Arial Narrow" SIZE="6" COLOR="#800000">&nbsp;</p>
<p></font><font FACE="Arial Narrow" SIZE="6"><b>Interface IWbemObjectSink</b></font><font
SIZE="2" COLOR="#ff00ff"></p>
</font><font FACE="Arial" SIZE="2">
<p>The <b>IWbemObjectSink</b> interface is a sink interface used for all types of
notifications within the CIMOM programming model. Clients must implement this interface to
receive both the results of the <u>asynchronous methods</u></font><font FACE="Arial"
SIZE="2" COLOR="#800000">_hmm_making_an_asynchronous_call</font><font FACE="Arial"
SIZE="2"> of <b>IWbemServices</b> and certain types of event notifications. Providers use,
but do not implement, this interface to provide events and objects to CIMOM.</p>
<p>Typically, providers call an implementation provided to them by CIMOM. In these cases,
you call <b>Indicate</b> to provide objects to COMOM. After that, call <b>SetStatus</b><i>
</i>to indicate the end of the notification sequence. You can also call <b>SetStatus</b>
to indicate errors when the sink does not have any objects. </p>
<p>When programming asynchronous clients of CIMOM, the user provides the implementation.
CIMOM calls the methods to deliver objects and set the status of the result.</p>
<p><b>&nbsp;</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_IWbemObjectSink_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_IwbemObjectSink_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_IwbemObjectSink_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>IWbemObjectSink 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>Indicate</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IwbemObjectSink_Indicate</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Receives notification objects.</font></td>
</tr>
<tr>
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>SetStatus</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IwbemObjectSink_SetStatus</font></td>
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Receives notification status.</font></td>
</tr>
</table>
<p><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Sample Code</b></font><font FACE="Arial" SIZE="2"></p>
<p>The following is a simple implementation of an object sink. This sample could be used
in conjunction with IWbemServices::ExecQueryAsync or
IWbemServices::CreateInstanceEnumAsync to receive the returned instances:</font><font
FACE="Lucida Sans Typewriter" SIZE="1"></p>
<p>class QuerySink : public IWbemObjectSink</p>
<p>{</p>
<p>LONG m_lRef;</p>
<p>Bool bDone;</p>
<p>public:</p>
<p>QuerySink() { m_lRef = 0; }</p>
<p>~QuerySink() { bDone = TRUE; }</p>
<p>virtual ULONG STDMETHODCALLTYPE AddRef();</p>
<p>virtual ULONG STDMETHODCALLTYPE Release(); </p>
<p>virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppv);</p>
<p>virtual HRESULT STDMETHODCALLTYPE Indicate( </p>
<p>/* [in] */ LONG lObjectCount,</p>
<p>/* [size_is][in] */ IWbemClassObject __RPC_FAR *__RPC_FAR *apObjArray</p>
<p>);</p>
<p>&nbsp;</p>
<p>virtual HRESULT STDMETHODCALLTYPE SetStatus( </p>
<p>/* [in] */ LONG lFlags,</p>
<p>/* [in] */ HRESULT hResult,</p>
<p>/* [in] */ BSTR strParam,</p>
<p>/* [in] */ IWbemClassObject __RPC_FAR *pObjParam</p>
<p>);</p>
<p>};</p>
<p>&nbsp;</p>
<p>ULONG QuerySink::AddRef()</p>
<p>{</p>
<p>return InterlockedIncrement(&amp;m_lRef);</p>
<p>}</p>
<p>ULONG QuerySink::Release()</p>
<p>{</p>
<p>LONG lRef = InterlockedDecrement(&amp;m_lRef);</p>
<p>if(lRef == 0)</p>
<p>delete this;</p>
<p>return lRef;</p>
<p>}</p>
<p>HRESULT QuerySink::QueryInterface(REFIID riid, void** ppv)</p>
<p>{</p>
<p>if (riid == IID_IUnknown || riid == IID_IWbemObjectSink)</p>
<p>{</p>
<p>*ppv = (IWbemObjectSink *) this;</p>
<p>AddRef();</p>
<p>return WBEM_S_NO_ERROR;</p>
<p>else return E_NOINTERFACE;</p>
<p>}</p>
<p>&nbsp;</p>
<p>HRESULT QuerySink::Indicate(long lObjCount, IWbemClassObject **pArray)</p>
<p>{</p>
<p>for (long i = 0; i &lt; lObjCount)</p>
<p>{</p>
<p>IWbemClassObject *pObj = pArray[i];</p>
<p>// ... use the object</p>
<p>// AddRef() only required if the object will be held after</p>
<p>// the return to the caller.</p>
<p>i++;</p>
<p>}</p>
<p>return WBEM_S_NO_ERROR;</p>
<p>}</p>
<p>HRESULT QuerySink::SetStatus(</p>
<p>/* [in] */ LONG lFlags,</p>
<p>/* [in] */ HRESULT hResult,</p>
<p>/* [in] */ BSTR strParam,</p>
<p>/* [in] */ IWbemClassObject __RPC_FAR *pObjParam</p>
<p>)</p>
<p>{</p>
<p>printf(&quot;QuerySink::SetStatus hResult = 0x%X\n&quot;, hResult);</p>
<p>return WBEM_S_NO_ERROR;</p>
<p>}</p>
<p></font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000">&nbsp;</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">IWbemObjectSink::QueryInterface</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000"><EFBFBD>@<40></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>IWbemObjectSink::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 IWbemObjectSink::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><i>&nbsp;</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><font FACE="Arial Narrow"><b>&nbsp;</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">IWbemObjectSink::AddRef</font><font FACE="Arial Narrow" SIZE="1" COLOR="#800000"><EFBFBD>@<40></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>IWbemObjectSink::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 <b>Release</b> 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">IWbemObjectSink::Release</font><font FACE="Arial Narrow" SIZE="1" COLOR="#800000"><EFBFBD>@<40></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>IWbemObjectSink::Release</b> method decreases the object's reference count by 1.
</font><b><font FACE="Lucida Sans Typewriter" SIZE="2"></p>
<p>ULONG 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_IWbemObjectSink_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">IWbemObjectSink::Indicate</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000"><EFBFBD>@<40></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>IWbemObjectSink::Indicate</b> method is called by a source to provide a
notification. Typically, CIMOM calls the client's implementation of this interface after
the client executes one of the asynchronous methods of <i>IWbemServices. </i>In other
cases, various types of providers call an implementation exported by CIMOM in order to
deliver events. Therefore, client code may have to implement this interface in some cases,
and use a different component's implementation in other cases.</p>
<p>Use this interface and method in conjunction with the asynchronous methods of the <b>IWbemServices</b>
interface.</p>
<p>Clients and providers must implement this interface to receive notifications or to
execute the asynchronous methods of <u><b>IWbemServices</b></u></font><font FACE="Arial"
SIZE="2" COLOR="#800000">_hmm_making_an_asynchronous_call</font><font FACE="Arial"
SIZE="2">.</font><font FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>HRESULT IWbemObjectSink::Indicate(</p>
<p>[in] LONG </b><i>lObjectCount</i><b>,</p>
<p>[in, size_is(lObjectCount)] IWbemClassObject</b><i> **ppObjArray</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>lObjectCount</p>
<blockquote>
</i><p>The number of objects in the following array of pointers.</p>
</blockquote>
<p><i>&nbsp;</p>
<p>ppObjArray</i></p>
<p>An array of pointers to <u><b>IWbemClassObject</b></u></font><font FACE="Arial"
SIZE="2" COLOR="#800000">_hmm_IWbemClassObject</font><font FACE="Arial" SIZE="2">
interfaces. The array memory itself is read-only, and is owned by the caller of the
method. Since this is an in-parameter, the implementation has the option of calling <u><b>IWbemClassObject::AddRef</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemClassObject_AddRef</font><font
FACE="Arial" SIZE="2"> on any object pointer in the array and holding it before returning
if the objects will be used after the method has returned, in accordance with COM rules.
If the objects will only be used for the duration of the Indicate call, then you do not
need to call AddRef on each object pointer. For more information on the <b>IUnknown </b>Interface
see <u>IUnknown Interface Basics</u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IUnknown_Interface_Basics</font><font
FACE="Arial" SIZE="2">.</p>
<blockquote>
<p>.</p>
</font><font FACE="Arial" SIZE="1"><p></font>&nbsp;</p>
</blockquote>
<p><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Return Values</b></font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_FAILED</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The receiver was not able to
process the notification properly.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_INVALID_PARAMETER</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">An invalid parameter was
specified, such as a NULL <i>ppObjArray</i> pointer.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_NO_ERROR</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The call succeeded; the receiver
acknowledges the notification.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">WBEM_E_UNKNOWN_OBJECT_TYPE</font></td>
<td WIDTH="49%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">Marshaling
received an invalid object type.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">WBEM_E_UNKNOWN_PACKET_TYPE</font></td>
<td WIDTH="49%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">Marshaling
received an invalid packet type.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">WBEM_E_MARSHAL_VERSION_MISMATCH</font></td>
<td WIDTH="49%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">Marshaling
version mismatch error.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">WBEM_E_MARSHAL_INVALID_SIGNATURE</font></td>
<td WIDTH="49%" VALIGN="TOP"><font face="Arial" size="2" color="#FF0000">Packet received
by marshaling had an invalid (unrecognized) signature.</font></td>
</tr>
</table>
<p><font FACE="Arial" SIZE="1">&nbsp;</p>
<p></font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000">&nbsp;</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">IWbemObjectSink::SetStatus</font><font FACE="Arial Narrow" SIZE="1"
COLOR="#800000"><EFBFBD>@<40></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>IWbemObjectSink::SetStatus</b> method is called by sources either to indicate
the end of a notification sequence or to send other status codes to the sink. <u><b>IWbemObjectSink::Indicate</b></u></font><font
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemObjectSink_Indicate</font><font
FACE="Arial" SIZE="2"> may or may not have been called before the call to <i>SetStatus</i>.</font><font
FACE="Arial" SIZE="2" COLOR="#008000"><b> </b></font><font FACE="Arial" SIZE="2"></p>
<p>Normally, a client implements the <b>IWbemObjectSink</b> interface, and executes <b>IWbemServices</b><i>
</i>methods that return their results using the <b>IWbemObjectSink</b> interface. During
this operation, CIMOM calls <b>Indicate</b> as many times as required, followed by a final
call to <b>SetStatus</b>, and in many cases, <b>Release</b>.</font><font
FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
<p>HRESULT IWbemObjectSink::SetStatus(</p>
<p>[in] LONG </b><i>lFlags</i><b>,</p>
<p>[in] HRESULT</b><i> hResult</i><b>, </p>
<p>[in] BSTR</b><i> strParam</i><b>, </p>
<p>[in] IWbemClassObject</b><i> *pObjParam</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>lFlags</p>
<blockquote>
</i><p>The lFlags parameter is a bitmask of status information. WBEM_STATUS_COMPLETE
indicates the operation has completed. </p>
<p>WBEM_STATUS_PROGRESS indicates the operation is still in progress. The status of the
operation can be obtained by examining the hResult parameter.</p>
</blockquote>
<p><i>&nbsp;</p>
<p>hResult</p>
<blockquote>
</i><p>This parameter is set to the HRESULT of the asynchronous operation or notification.
This will be either an error code, if an error occurred, or the amount of progress that
has been made on an asynchronous call. Only callers that requested status reports by
specifying WBEM_SEND_STATUS as a lFlags parameter will receive status updates. The exact
status can be determined by examining the HIWORD and LOWORD of the hResult separately. The
LOWORD(</font><font FACE="Arial" SIZE="2" COLOR="#ff0000">hResult</font><font FACE="Arial"
SIZE="2">) contains the amount of progress that has been made so far and the
HIWORD(hResult) contains the total..</p>
</blockquote>
<p><i>&nbsp;</p>
<p>strParam</p>
<blockquote>
</i><p>Receives a pointer to a read-only BSTR, if the original asynchronous operation
returns a string. For example, when using <b>PutInstanceAsync</b>,<i> </i><b>IWbemObjectSink::SetStatus</b>
is called with this parameter set to the object path of the newly created instance.</p>
</blockquote>
<p><i>&nbsp;</p>
<p>pObjParam</p>
<blockquote>
</i><p>In cases where a complex error or status object is returned, this contains a
pointer to the error object. If the object is required after <b>SetStatus</b> returns, the
called object must use the <b>AddRef</b> method on the pointer before the called object
returns.</p>
</font><font FACE="Arial" SIZE="1"><p></font>&nbsp;</p>
</blockquote>
<p><font FACE="Arial Narrow"><b>&nbsp;</p>
<p>Return Values</b></font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_FAILED</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The receiver was not able to
process the notification properly.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_INVALID_PARAMETER</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">An invalid parameter was
specified.</font></td>
</tr>
<tr>
<td WIDTH="51%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_NO_ERROR</font></td>
<td WIDTH="49%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The call succeeded; the receiver
acknowledges the notification.</font></td>
</tr>
</table>
</body>
</html>