<div class="content"><p>The RpcEnumMonitors method retrieves information about the <a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_1b5f368b-942b-40dd-84ea-fa9082916216" data-linktype="relative-path">port monitors</a> installed on
the specified server.</p><dl>
<dd>
<div><pre> DWORD RpcEnumMonitors(
   [in, string, unique] STRING_HANDLE pName,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pMonitor,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded,
   [out] DWORD* pcReturned
 );
</pre></div>
</dd></dl><p><b>pName: </b>This parameter MUST adhere to the
parameter specification in <a href="acb355a4-913b-4abb-8cb5-415aea160015" data-linktype="relative-path">Print
Server Name Parameters</a>, section 3.1.4.1.4.</p><p><b>Level: </b>This value refers to the level of port
monitor information structure, as follows.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Corresponds to <a href="0496f2b4-c42c-4363-bb03-2a5df819f7ba" data-linktype="relative-path">_MONITOR_INFO_1</a> (section
  2.2.2.7.1).</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000002</p>
  </td>
  <td>
  <p>Corresponds to <a href="a69e6785-18be-483a-90f9-7a283df84fbf" data-linktype="relative-path">_MONITOR_INFO_2</a> (section
  2.2.2.7.2).</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>pMonitor: </b>This parameter SHOULD be ignored if <i>cbBuf</i>
equals zero; otherwise, it is a pointer to the <a href="f29e9057-df29-40d4-9c51-c615c0da62a1" data-linktype="relative-path">BUFFER</a>, as specified in
INFO Structures Query Parameters, section 3.1.4.1.9.</p><p><b>BUFFER TYPE:</b> _MONITOR_INFO.</p><p><b>cbBuf: </b>This parameter MUST adhere to the parameter
specification in INFO Structures Query Parameters, section 3.1.4.1.9.</p><p><b>pcbNeeded: </b>This parameter MUST adhere to the
parameter specification in INFO Structures Query Parameters, section 3.1.4.1.9.</p><p><b>pcReturned: </b>This parameter MUST adhere to the
parameter specification in INFO Structures Query Parameters, section 3.1.4.1.9.</p><p><b>Return Values: </b>This method MUST return zero
(ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error
code to indicate failure <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.</p><p>Upon receiving this message, the server MUST validate
parameters as follows:</p><ul><li><p><span><span> 
</span></span>Perform the validation steps that are specified in Print Server
Name Parameters, section 3.1.4.1.4.</p>
</li><li><p><span><span> 
</span></span>Perform the validation steps that are specified in INFO
Structures Query Parameters, section 3.1.4.1.9.</p>
</li><li><p><span><span> 
</span></span>Additional validation MAY<a id="Appendix_A_Target_366"></a><a aria-label="Product behavior note 366" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_366" data-linktype="relative-path">&lt;366&gt;</a> be
performed.</p>
</li></ul><p>If parameter validation fails, the server MUST fail the operation
immediately and return a nonzero error response to the client. Otherwise, the
server MUST process the message and compose a response to the client as
follows:</p><ul><li><p><span><span> 
</span></span>Enumerate all port monitors supporting the methods listed as
required or optional in section <a href="07ce2051-23c6-4d50-8f55-c25d7ac09cb3" data-linktype="relative-path">Monitor Module
Methods (section 3.1.4.11)</a> on the <a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print server</a>.<a id="Appendix_A_Target_367"></a><a aria-label="Product behavior note 367" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_367" data-linktype="relative-path">&lt;367&gt;</a></p>
</li><li><p><span><span> 
</span></span>Using the enumerated objects, perform the processing and response
steps specified in INFO Structures Query Parameters, section 3.1.4.1.9.</p>
</li><li><p><span><span> 
</span></span>Return the status of the operation.</p>
</li></ul></div>