<div class="content" name="RpcAsyncOpenPrinter" uuid="feddac6a-bd88-4989-95fb-715bd6ca796a"><p><b>RpcAsyncOpenPrinter</b> retrieves a handle to a specified
printer, port, <span><a href="a98de8d9-8e9e-4cd7-92f7-f9269206a41e#gt_12a6e569-e97c-4761-92f0-e397f8d5125f" data-linktype="relative-path">print job</a></span> or <span><a href="a98de8d9-8e9e-4cd7-92f7-f9269206a41e#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print
server</a></span>. A client uses this method to obtain a print handle to an
existing printer on a remote computer.</p><p>The counterpart of this method in the Print System Remote
Protocol is <b>RpcOpenPrinterEx</b>. All parameters not defined below are
specified in <span><a href="../ms-rprn/d42db7d5-f141-4466-8f47-0a4be14e2fc1" data-linktype="relative-path">[MS-RPRN]</a></span>
section <span><a href="../ms-rprn/0e81ce18-72b1-46c3-8584-a205393b04ff" data-linktype="relative-path">3.1.4.2.14</a></span>.</p><dl>
<dd>
<div><pre> DWORD RpcAsyncOpenPrinter(
   [in] handle_t hRemoteBinding,
   [in, string, unique] wchar_t* pPrinterName,
   [out] PRINTER_HANDLE* pHandle,
   [in, string, unique] wchar_t* pDatatype,
   [in] DEVMODE_CONTAINER* pDevModeContainer,
   [in] DWORD AccessRequired,
   [in] SPLCLIENT_CONTAINER* pClientInfo
 );
</pre></div>
</dd></dl><p><b>hRemoteBinding: </b>An <span><a href="a98de8d9-8e9e-4cd7-92f7-f9269206a41e#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> explicit binding
handle.</p><p><b>Return Values: </b>This method returns zero to indicate
successful completion or a nonzero Win32 error code (<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>)
to indicate failure. The client MUST treat any nonzero return value as a fatal
error.</p><p><b>Exceptions Thrown:</b> This method MUST NOT throw any
exceptions other than those that are thrown by the underlying RPC protocol <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p><p>This method MUST adhere to the parameter validation, processing,
and response requirements that are specified in [MS-RPRN] section 3.1.4.2.14.</p></div>