<div class="content" name="RpcEnumPrinterDrivers" uuid="857d00ac-3682-4a0d-86ca-3d3c372e5e4a"><p>RpcEnumPrinterDrivers enumerates the <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_1a48eebd-e72c-494d-b8cb-84dfb7bc3b65" data-linktype="relative-path">printer
drivers</a></span> installed on a specified <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print server</a></span>.</p><dl>
<dd>
<div><pre> DWORD RpcEnumPrinterDrivers(
   [in, string, unique] STRING_HANDLE pName,
   [in, string, unique] wchar_t* pEnvironment,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf)] 
     BYTE* pDrivers,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded,
   [out] DWORD* pcReturned
 );
</pre></div>
</dd></dl><p><b>pName: </b>Specified in <span><a href="acb355a4-913b-4abb-8cb5-415aea160015" data-linktype="relative-path">Print Server Name
Parameters (section 3.1.4.1.4)</a></span>.</p><p><b>pEnvironment: </b>Specified in <span><a href="5b2bf7d5-ac77-464f-be5e-f3a7c1782246" data-linktype="relative-path">Environment
Name Parameters (section 3.1.4.1.3)</a></span>.<a id="Appendix_A_Target_327"></a><a aria-label="Product behavior note 327" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_327" data-linktype="relative-path">&lt;327&gt;</a></p><p><b>Level: </b>The driver information level.</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 _DRIVER_INFO_1 (section 2.2.2.4.1).</td>
 </tr><tr>
  <td>0x00000002</td>
  <td>Corresponds to _DRIVER_INFO_2 (section 2.2.2.4.2).</td>
 </tr><tr>
  <td>0x00000003</td>
  <td>Corresponds to _DRIVER_INFO_3 (section 2.2.2.4.3).</td>
 </tr><tr>
  <td>0x00000004</td>
  <td>Corresponds to _DRIVER_INFO_4 (section 2.2.2.4.4).</td>
 </tr><tr>
  <td>0x00000005</td>
  <td>Corresponds to _DRIVER_INFO_5 (section 2.2.2.4.5).</td>
 </tr><tr>
  <td>0x00000006</td>
  <td>Corresponds to _DRIVER_INFO_6 (section 2.2.2.4.6).</td>
 </tr><tr>
  <td>0x00000008</td>
  <td>Corresponds to _DRIVER_INFO_8 (section 2.2.2.4.8).</td>
 </tr></tbody></table>
</dd></dl><p><b>pDrivers: </b>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> _DRIVER_INFO.</p><dl>
<dd>
<p>This parameter can be NULL if <i>cbBuf</i> equals
zero.</p>
</dd></dl><p><b>cbBuf: </b>Specified in INFO Structures Query Parameters (section 3.1.4.1.9).</p><p><b>pcbNeeded: </b>Specified in INFO Structures Query
Parameters (section 3.1.4.1.9).</p><p><b>pcReturned: </b>Specified 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 perform the
validation steps specified in the following sections:</p><ul><li><p><span><span> 
</span></span>Print Server Name Parameters (section 3.1.4.1.4).</p>
</li><li><p><span><span> 
</span></span>Environment Name Parameters (section 3.1.4.1.3).</p>
</li><li><p><span><span> 
</span></span>INFO Structures Query Parameters (section 3.1.4.1.9).</p>
</li></ul><p>Additional validation MAY<a id="Appendix_A_Target_328"></a><a aria-label="Product behavior note 328" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_328" data-linktype="relative-path">&lt;328&gt;</a> be
performed.</p><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:<a id="Appendix_A_Target_329"></a><a aria-label="Product behavior note 329" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_329" data-linktype="relative-path">&lt;329&gt;</a></p><ul><li><p><span><span> 
</span></span>Enumerate all drivers on the specified print server that match
the requested environment.</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>If at any point during the operation the print server failed to
calculate the size of the <b>INFO</b> structure for any printer driver, the
print server SHOULD fail the operation immediately and return ERROR_CAN_NOT_COMPLETE.<a id="Appendix_A_Target_330"></a><a aria-label="Product behavior note 330" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_330" data-linktype="relative-path">&lt;330&gt;</a></p>
</li><li><p><span><span> 
</span></span>Return the status of the operation.</p>
</li></ul></div>