3.1.4.8.3 RpcAsyncWritePrinter (Opnum 12)

RpcAsyncWritePrinter adds data to the file representing the spool file for a specified printer, if the spooling option is turned on; or it sends data to the device directly, if the printer is configured for direct printing.

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

 DWORD RpcAsyncWritePrinter(
   [in] PRINTER_HANDLE hPrinter,
   [in, size_is(cbBuf)] unsigned char* pBuf,
   [in] DWORD cbBuf,
   [out] DWORD* pcWritten
 );

hPrinter: A handle to a printer object or port object that was opened by using either RpcAsyncOpenPrinter (section 3.1.4.1.1) or RpcAsyncAddPrinter (section 3.1.4.1.2).

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.9.3.