<div class="content" name="RpcEnumMonitors" uuid="6c5836fe-d9ea-41a0-ad7e-01152f39e8a1"><p>The RpcEnumMonitors method retrieves information about the <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_1b5f368b-942b-40dd-84ea-fa9082916216" data-linktype="relative-path">port
monitors</a></span> 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)] 
     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 <span><a href="acb355a4-913b-4abb-8cb5-415aea160015" data-linktype="relative-path">Print Server Name Parameters</a></span>,
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>0x00000001</td>
  <td>Corresponds to _MONITOR_INFO_1 (section 2.2.2.7.1).</td>
 </tr><tr>
  <td>0x00000002</td>
  <td>Corresponds to _MONITOR_INFO_2 (section 2.2.2.7.2).</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 <span><a href="f29e9057-df29-40d4-9c51-c615c0da62a1" data-linktype="relative-path">BUFFER</a></span>, 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 <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>.</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 <span><a href="07ce2051-23c6-4d50-8f55-c25d7ac09cb3" data-linktype="relative-path">Monitor Module
Methods (section 3.1.4.11)</a></span> on the <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print
server</a></span>.<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>