<div class="content"><p> </p><p>The <b>FAX_EnumMessagesEx (Opnum 91)</b> method is called by
the client. This message differs from the <b>FAX_EnumMessages</b> (section <span><a href="365c2295-c0f9-44bd-a72b-6db0b16c0f8f" data-linktype="relative-path">3.1.4.1.24</a></span>)
in that this function takes a <i>level</i> parameter, which differentiates the
type of message information structure that the function returns.</p><p>In response, the server MUST validate that the <i>hEnum</i>
argument that is passed by the client was created as part of a prior <b>FAX_StartMessagesEnum</b>
(section <span><a href="702db5ea-5293-46f3-b11e-ad8f477bbe26" data-linktype="relative-path">3.1.4.1.98</a></span>) or <b>FAX_StartMessagesEnumEx</b>
(section <span><a href="1911d0be-4274-4da1-944d-100ae92d8d74" data-linktype="relative-path">3.1.4.1.99</a></span>) call.
The server MUST validate that the <i>dwNumMessages</i> argument is not zero.</p><p>On success, the server MUST return information regarding
messages. The server MUST return the size of the returned information and the
number of messages for which it could successfully retrieve the information.
The latter value MUST NOT exceed <i>dwNumMessages</i>. The server MUST return
the level of information. This return value is decided by whether the client
used <b>FAX_StartMessagesEnum</b> or <b>FAX_StartMessagesEnumEx</b> to start
the enumeration of messages.</p><p>The client SHOULD free the returned buffer.</p><p>Protocol version FAX_API_VERSION_0 (0x00000000),
FAX_API_VERSION_1 (0x00010000), and  FAX_API_VERSION_2 (0x00020000) fax servers
SHOULD NOT implement this call. The fax client MUST NOT call this method if the
protocol version reported by the server is FAX_API_VERSION_0 (0x00000000),
FAX_API_VERSION_1 (0x00010000), or FAX_API_VERSION_2 (0x00020000). For more
information, see <b>FAX_ConnectFaxServer</b> (section <span><a href="5cbfd38d-7a14-4560-ad24-9ed78f19a3bb" data-linktype="relative-path">3.1.4.1.10</a></span>).</p><dl>
<dd>
<div><pre> error_status_t FAX_EnumMessagesEx(
   [in, ref] RPC_FAX_MSG_ENUM_HANDLE hEnum,
   [in] DWORD dwNumMessages,
   [out, size_is(,*lpdwBufferSize)] 
     LPBYTE* lppBuffer,
   [out, ref] LPDWORD lpdwBufferSize,
   [out, ref] LPDWORD lpdwNumMessagesRetrieved,
   [out, ref] LPDWORD lpdwLevel
 );
</pre></div>
</dd></dl><p><b>hEnum: </b>The enumeration handle returned through
the <i>lpHandle</i> output argument by <b>FAX_StartMessagesEnum</b> or <b>FAX_StartMessagesEnumEx</b>.</p><p><b>dwNumMessages: </b>A <b>DWORD</b> (<span><a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a></span>
section <span><a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">2.2.9</a></span>)
value that indicates the maximum number of messages that the caller requires to
enumerate. This value MUST NOT be zero.</p><p><b>lppBuffer: </b>A pointer to an array of <b>FAX_MESSAGE_1</b>
(section <span><a href="353bdf06-225c-4274-b24b-d7832a196675" data-linktype="relative-path">2.2.37</a></span>) structures
that contain <i>lpdwNumMessagesRetrieved</i> entries.</p><p><b>lpdwBufferSize: </b>A pointer to a <b>DWORD</b>
value that specifies the size, in bytes, of the buffer.</p><p><b>lpdwNumMessagesRetrieved: </b>A pointer to a <b>DWORD</b>
value that indicates the actual number of retrieved messages. This value SHOULD
NOT exceed <i>dwNumMessages</i>.</p><p><b>lpdwLevel: </b>A pointer to a <b>DWORD</b> value
that indicates the structure to return.</p><p><b>Return Values: </b>This method MUST return
0x00000000 (ERROR_SUCCESS) for success; otherwise, it MUST return one of the
following error codes, one of the fax-specific errors that are defined in
section <span><a href="cbe6c4fb-4dda-4f6c-9701-0d490ba0d105" data-linktype="relative-path">2.2.52</a></span>, or one of
the other standard errors defined in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>ERROR_NOT_ENOUGH_MEMORY</p>
  <p>0x00000008</p>
  </td>
  <td>
  <p>The fax server failed to allocate memory for the
  return buffer.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p>The parameter is incorrect. This error code is
  returned if any of the following conditions are met:</p>
  <p><span>§<span>  
  </span></span>One or more of the pointer values specified by the following
  arguments are NULL: <i>lppBuffer</i>, <i>lpdwBufferSize</i>, <i>lpdwNumMessagesRetrieved</i>, 
  and <i>lpdwLevel</i>.</p>
  <p><span>§<span>  
  </span></span><i>hEnum</i> is NULL<a id="Appendix_A_Target_90"></a><a aria-label="Product behavior note 90" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_90" data-linktype="relative-path">&lt;90&gt;</a> or is
  an invalid handle that is not returned by a call to <b>FAX_StartMessagesEnum</b>
  or <b>FAX_StartMessagesEnumEx</b> <a id="Appendix_A_Target_91"></a><a aria-label="Product behavior note 91" href="056171e7-80bc-45ff-8107-66ba3abb2023#Appendix_A_91" data-linktype="relative-path">&lt;91&gt;</a>.</p>
  <p><span>§<span>  
  </span></span><i>dwNumMessages</i> is zero.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_BUFFER_OVERFLOW</p>
  <p>0x0000006F</p>
  </td>
  <td>
  <p>The fax server encountered an integer overflow
  condition while processing the request for the maximum number of messages
  specified by the <i>dwNumMessages</i> argument.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_NO_MORE_ITEMS</p>
  <p>0x00000103</p>
  </td>
  <td>
  <p>No more data is available. The method reached the end
  of the <i>lppBuffer</i> message buffer and there are no more messages to be
  enumerated.</p>
  </td>
 </tr><tr>
  <td>
  <p>FAX_ERR_SRV_OUTOFMEMORY</p>
  <p>0x00001B59</p>
  </td>
  <td>
  <p>The fax server failed to allocate memory needed for
  internal execution of the command.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The client implementation assumes that this method is incremental
and uses an internal context cursor to point to the next set of messages to
retrieve for each call. The cursor is set to point to the beginning of the
messages in the archive after a successful call to <b>FAX_StartMessagesEnum</b>
or <b>FAX_StartMessagesEnumEx</b>. Each successful call to <b>FAX_EnumMessagesEx</b>
advances the cursor by the number of messages retrieved. After the cursor
reaches the end of the enumeration, the method fails with the 0x00000103
(ERROR_NO_MORE_ITEMS) error code. The <b>FAX_EndMessagesEnum</b> (section <span><a href="df9d34cf-780d-4e26-af24-eadb73ef443f" data-linktype="relative-path">3.1.4.1.16</a></span>)
method can then be called to halt the enumeration of messages.</p><p><b>Exceptions Thrown: </b>No exceptions are thrown
except those that are thrown by the underlying <span><a href="46aba9c4-ebb1-4b10-86ac-4bb3025657b9#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> protocol, <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p></div>