188.8.131.52.5 RpcAbortPrinter (Opnum 21)
RpcAbortPrinter aborts the currently spooling print document.
DWORD RpcAbortPrinter( [in] PRINTER_HANDLE hPrinter );
hPrinter: A handle to a printer object or port object that was opened by RpcAddPrinter (section 184.108.40.206.3), RpcAddPrinterEx (section 220.127.116.11.15), RpcOpenPrinter (section 18.104.22.168.2), or RpcOpenPrinterEx (section 22.214.171.124.14).
Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].
Upon receiving this message, the server MUST validate parameters as follows:
Perform the validation steps that are specified in PRINTER_HANDLE Parameters (section 126.96.36.199.11). This method SHOULD assume that the handle to the printer or port object can be used without further access checks.
Verify that a job has been associated with hPrinter by using RpcStartDocPrinter, and if that verification fails, return ERROR_SPL_NO_STARTDOC [MS-ERREF].
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:
The current job is aborted. If it is in spool stage, spooling MUST stop. If it is in printing stage, printing MUST stop.
Modify the job object to indicate that the job has been aborted.
Delete the spool file, if one exists.
Delete the job object.
Modify the list of jobs to exclude this deleted job.
Return the status of the operation.