SplPdAbortDoc

SplPdAbortDoc is an API exported by port drivers. It is called by PrtAbort and PrtAbortDoc for document-abort processing. If FLG_COMPLETE_DATA is set, all prior data for this job is sent to the printer. If FLG_COMPLETE_DATA is not set, all current write requests for this job are flushed and then the buffer of data is sent to reset the printer.

FLG_COMPLETE_DATA is always set if the printer driver calls PrtAbort, because some older printer drivers send the reset sequence to the printer using PrtWrite, then call PrtAbort to abort the job. In this case, the printer driver relies on only PrtWrite returning after the data was sent to the printer.

Syntax
SplPdAbortDoc(hDevice, pchData, cbData, ulFlags);

Parameters

 * hDevice (HFILE) - input
 * Handle from SplPdOpen.


 * pchData (PVOID) - input
 * Pointer to data buffer to write after flushing all current write data.


 * cbData (ULONG) - input
 * Length of data, in bytes.


 * May be 0 (zero) for no data to write.


 * ulFlags (ULONG) - input
 * Abort processing flags.


 * Value is as follows:


 * FLG_COMPLETE_DATA - 0x00000001
 * If set, then all prior data for this job must be sent to the printer.

Returns

 * rc (ULONG) - returns : Return codes.


 * 0 Success
 * 6(ERROR_INVALID_HANDLE)
 * Invalid handle given.


 * 29(ERROR_WRITE_FAULT)
 * Failure attempting to write reset sequence to the device.

Sample

 * 1) define INCL_SPL
 * 2) define INCL_SPLBIDI
 * 3) include 

HFILE   hDevice;  /*  Handle from SplPdOpen. */ PVOID   pchData;  /*  Pointer to data buffer to write after flushing all current write data. */ ULONG   cbData;   /*  Length of data, in bytes. */ ULONG   ulFlags;  /*  Abort processing flags. */ ULONG   rc;       /*  Return codes. */

rc = SplPdAbortDoc(hDevice, pchData, cbData, ulFlags);

Remarks
SplPdClose must still be issued to close the device connection.