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

164 lines
7.1 KiB
HTML

<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Interface IWbemWCOSmartEnum</title>
</head>
<body bgcolor="#FFFFC1">
<font FACE="Arial Narrow" SIZE="6" COLOR="#800000">
<p></font><font face="Arial Narrow" size="6"><b>Interface IWbemWCOSmartEnum</b></font><font
SIZE="2" COLOR="#ff00ff"></p>
</font><font FACE="Arial" SIZE="2">
<p>The <strong>IWbemWCOSmartEnum</strong> interface is intended to allow enumerators
access to more efficient object representations during an enumeration.&nbsp; The <strong>IWbemObjectSink</strong>
marshaling was modified to compress <strong>IWbemClassObject</strong> instances on
sending, by stripping redundant class data, and decompressing data on receipt by mergine <strong>IWbemClassObject</strong>
instances with shared class data via the <strong>IWbemObjectInternals</strong> interface.
&nbsp; Because the <strong>IEnumWbemClassObject</strong> is actually controlled by our
server, by implementing this interface, the client side can query for this interface and
use it as a pass through to another interface.&nbsp; This is currently used by<strong>
WINMGMT</strong> in conjunction with its <strong>IWbemEnumClassObject</strong> interface
implementation, to perform &quot;smart&quot; enumerations.</p>
</font>
<p><font FACE="Arial" SIZE="2">This interface is derived from <strong>IUnknown </strong>and
supports its methods.</font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="597">
<tr>
<td VALIGN="TOP" COLSPAN="2" width="549"></td>
</tr>
<tr>
<td WIDTH="232" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>IWbemWCOSmartEnum Methods</b></font></td>
<td WIDTH="361" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>Description</b></font></td>
</tr>
<tr>
<td WIDTH="232" VALIGN="TOP"><a href="#IWbemWCOSmartEnum::Next"><font face="Arial"
size="2" color="#008000"><u><strong>Next</strong></u></font></a></td>
<td WIDTH="361" VALIGN="TOP"><font face="Arial" size="2" color="#008000">Returns requested
objects in a byte array that must be unmarshaled into an object array.</font></td>
</tr>
</table>
<p>&nbsp;</p>
<hr>
<font FACE="Arial Narrow" SIZE="5" COLOR="#800000">
<p></font><a name="IWbemWCOSmartEnum::Next"><font face="Arial Narrow" size="5"><b>IWbemWCOSmartEnum::Next</b></font></a><font
SIZE="2" COLOR="#ff00ff"></p>
</font>
<p><font face="Arial" size="2">The <b>IWbemWCOSmartEnum::Next</b> method returns a byte
array that must be unmarshaled by the receiver into an array of objects.&nbsp; It requires
that the client and server understand the format of the byte array so that appropriate
marshaling/unmarshaling can occur.</font></p>
<b><font FACE="Lucida Sans Typewriter" SIZE="2">
<p></font><font FACE="Lucida Sans Typewriter" SIZE="2" color="#008000">HRESULT Next(<br>
&nbsp;&nbsp;&nbsp; [in] REFGUID proxyGUID,<br>
&nbsp;&nbsp;&nbsp; [in] LONG lTimeout,<br>
&nbsp;&nbsp;&nbsp; [in] ULONG uCount,<br>
&nbsp;&nbsp;&nbsp; [out] ULONG* puReturned,<br>
&nbsp;&nbsp;&nbsp; [out] ULONG* pdwBuffSize,<br>
&nbsp;&nbsp;&nbsp; [out, size_is(,*pdwBuffSize)] byte** pBuffer<br>
&nbsp;&nbsp;&nbsp; );</font><font FACE="Lucida Sans Typewriter" SIZE="2"></p>
</font></b>
<p><b><font FACE="Lucida Sans Typewriter" SIZE="2" color="#008000"><br>
</font><font FACE="Arial Narrow">Parameters</font></b></p>
<font FACE="Arial" SIZE="2"><i>
<p>proxyGUID<br>
</i>GUID that uniquely identifies the caller to the implementor.</p>
<i>
<p>lTimeout<br>
</i>Specifies the maximum amount of time in milliseconds that the call will block before
returning. If you use the Constant WBEM_INFINITE (-1), the call blocks until objects are
available. If you use the value zero (WBEM_NO_WAIT), the call will return immediately,
whether any objects are available or not. Negative values other than -1 are invalid.</p>
<i>
<p>uCount<br>
</i>The number of requested objects.<i></p>
<p>puReturned<br>
</i>A pointer to a <b>ULONG</b> that receives the number of objects returned. This number
can be less than the number requested in uCount. This pointer cannot be NULL.</p>
<i>
<p>pdwBuffSize<br>
</i>A pointer to a <b>ULONG</b> that receives the size of the buffer pointed to by
pBuffer.</p>
<i>
<p>ppBuffer<br>
</i>A pointer to a byte array.&nbsp; The implementor allocates the buffer using
CoTaskMemAlloc().&nbsp; The caller must free the buffer using CoTaskMemFree() when
finished with the buffer.&nbsp; The contents of the buffer must be previously agreed upon
by the caller and the implementor.</p>
</font>
<p><font FACE="Arial" SIZE="2"><font FACE="Arial Narrow"><b>Return Values</b></font></font></p>
<table CELLSPACING="0" BORDER="0" WIDTH="463">
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_INVALID_PARAMETER</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">One or more invalid parameters
were specified in the call.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_OUT_OF_MEMORY</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">There was not enough memory to
complete the enumeration.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_UNEXPECTED</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">An object in the enumeration has
been deleted destroying the validity of the enumeration.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_E_TRANSPORT_FAILURE</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">This indicates the failure of the
remote procedure call (RPC) link between the current process and CIMOM.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_NO_ERROR</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The number of objects returned
was the same as the number requested.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_FALSE</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">The number of objects returned
was less than the number requested.</font></td>
</tr>
<tr>
<td WIDTH="53%" VALIGN="TOP"><font FACE="Arial" SIZE="2">WBEM_S_TIMEDOUT</font></td>
<td WIDTH="47%" VALIGN="TOP"><font FACE="Arial" SIZE="2">A timeout occurred before you
obtained all the objects.</font></td>
</tr>
</table>
<font FACE="Arial" SIZE="2">
<p><strong>Notes</strong></p>
</font>
<p><font face="Arial" size="2">The IEnumWbemClassObject::Next method may return
WBEM_S_FALSE even when objects have been returned successfully. WBEM_S_NO_ERROR returns
only when the number of objects returned matches the number requested in <i>uCount</i>.
Therefore, you should use loop termination logic that examines the <i>puReturned</i> value
to ensure you have reached the end of the enumeration.</font></p>
<p><br>
<font FACE="Arial Narrow"><b>See Also</b></font></p>
<b><font FACE="Arial" SIZE="2"><u>
<p></u></font><font size="2" color="#000000">IEnumWbemClassObject::Next<br>
</font></b></p>
</body>
</html>