3.1.4.1.1 RpcAsyncOpenPrinter (Opnum 0)

RpcAsyncOpenPrinter retrieves a handle to a specified printer, port, print job or print server. A client uses this method to obtain a print handle to an existing printer on a remote computer.

The counterpart of this method in the Print System Remote Protocol is RpcOpenPrinterEx. All parameters not defined below are specified in [MS-RPRN] section 3.1.4.2.14.

 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
 );

hRemoteBinding: An RPC explicit binding handle.

Return Values: This method returns zero to indicate successful completion or a nonzero Win32 error code ([MS-ERREF] section 2.2) to indicate failure. The client MUST treat any nonzero return value as a fatal error.

Exceptions Thrown: This method MUST NOT throw any exceptions other than those that are thrown by the underlying RPC protocol [MS-RPCE].

This method MUST adhere to the parameter validation, processing, and response requirements that are specified in [MS-RPRN] section 3.1.4.2.14.