<div class="content"><p>RpcGetPrinter retrieves information about a specified
printer.</p><dl>
<dd>
<div><pre> DWORD RpcGetPrinter(
   [in] PRINTER_HANDLE hPrinter,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pPrinter,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded
 );
</pre></div>
</dd></dl><p><b>hPrinter: </b>A handle to a printer object that
was opened by <a href="bd0bb8d5-26fd-4705-81f5-614d32b9f38f" data-linktype="relative-path">RpcAddPrinter (section 3.1.4.2.3)</a>,
<a href="3af45717-308f-4b4f-8428-430d12856110" data-linktype="relative-path">RpcAddPrinterEx (section 3.1.4.2.15)</a>,
<a href="989357e2-446e-4872-bb38-1dce21e1313f" data-linktype="relative-path">RpcOpenPrinter (section 3.1.4.2.2)</a>,
or <a href="0e81ce18-72b1-46c3-8584-a205393b04ff" data-linktype="relative-path">RpcOpenPrinterEx (section 3.1.4.2.14)</a>.
This value MAY be a handle to a <a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print server</a> object.<a id="Appendix_A_Target_277"></a><a aria-label="Product behavior note 277" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_277" data-linktype="relative-path">&lt;277&gt;</a></p><p><b>Level: </b>The level of printer 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>0x00000000</p>
  </td>
  <td>
  <p>Corresponds to <a href="b026cf5c-680f-464a-8e08-675228ddd42c" data-linktype="relative-path">_PRINTER_INFO_STRESS (section 2.2.2.9.1)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Corresponds to <a href="39aa2f28-ffe0-4f91-8bdd-c0fa5dee40c5" data-linktype="relative-path">_PRINTER_INFO_1 (section 2.2.2.9.2)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000002</p>
  </td>
  <td>
  <p>Corresponds to <a href="9e327375-7ac9-419f-a610-61b88bbbd918" data-linktype="relative-path">_PRINTER_INFO_2 (section 2.2.2.9.3)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000003</p>
  </td>
  <td>
  <p>Corresponds to <a href="0cc3c483-6714-4682-aee4-54f588cab949" data-linktype="relative-path">_PRINTER_INFO_3 (section 2.2.2.9.4)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000004</p>
  </td>
  <td>
  <p>Corresponds to <a href="b7394523-48b7-4e16-bc9d-3c87d8a5f0c0" data-linktype="relative-path">_PRINTER_INFO_4 (section 2.2.2.9.5)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000005</p>
  </td>
  <td>
  <p>Corresponds to <a href="68a546b0-d748-4a3d-a5d7-37f713e037d9" data-linktype="relative-path">_PRINTER_INFO_5 (section 2.2.2.9.6)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000006</p>
  </td>
  <td>
  <p>Corresponds to <a href="f784565a-2b81-4cc0-a1e3-1c77212f7e28" data-linktype="relative-path">_PRINTER_INFO_6 (section 2.2.2.9.7)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000007</p>
  </td>
  <td>
  <p>Corresponds to <a href="01d35051-1b39-45f8-ad39-64391d8fb445" data-linktype="relative-path">_PRINTER_INFO_7 (section 2.2.2.9.8)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000008</p>
  </td>
  <td>
  <p>Corresponds to <a href="55f96f18-a134-4778-b1fa-556a801997b7" data-linktype="relative-path">_PRINTER_INFO_8 (section 2.2.2.9.9)</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000009</p>
  </td>
  <td>
  <p>Not valid remotely; the server MUST respond by
  returning ERROR_NOT_SUPPORTED.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>pPrinter: </b>A pointer to a <a href="f29e9057-df29-40d4-9c51-c615c0da62a1" data-linktype="relative-path">BUFFER</a> (INFO Structures
Query Parameters (section 3.1.4.1.9)).</p><p><b>BUFFER TYPE:</b> _PRINTER_INFO.</p><p><b>cbBuf: </b>A parameter specified in INFO
Structures Query Parameters.</p><p><b>pcbNeeded: </b>A parameter specified in INFO
Structures Query Parameters.</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 specified in <a href="10bfa8c2-d456-4ad0-912d-e674766a36c8" data-linktype="relative-path">PRINTER_HANDLE
Parameters (section 3.1.4.1.11)</a>.</p>
</li><li><p><span><span> 
</span></span>Perform the validation steps specified in INFO Structures Query
Parameters.</p>
</li><li><p><span><span> 
</span></span>Additional validation MAY<a id="Appendix_A_Target_278"></a><a aria-label="Product behavior note 278" href="e81cbc09-ab05-4a32-ae4a-8ec57b436c43#Appendix_A_278" data-linktype="relative-path">&lt;278&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>Using information about the printer, perform the processing and
response steps specified in INFO Structures Query Parameters.</p>
</li><li><p><span><span> 
</span></span>Return the status of the operation.</p>
</li></ul></div>