#include <nwqms.h> or #include <nwcalls.h>NWCCODE N_API NWAbortServicingQueueJob2 (NWCONN_HANDLE conn, nuint32 QueueID, nuint32 JobNumber, NWFILE_HANDLE fileHandle);
NWAbortServicingQueueJob2 closes the job file and resets the job server's access rights to their original (login) values. Only a queue server that has previously accepted a job for service can call NWAbortServicingQueueJob2.
An aborted job returns to its former position in the job queue if its
QF_ENTRY_RESTRART flag (bit 0x10 of jobControlFlags
in
QueueJobStruct) is set. For example, if a job is at the beginning
of the queue before being called, it returns to the beginning of the queue
after being aborted. Therefore, an aborted job could remain in
the queue and be serviced and aborted again and again. A job should not
be aborted because of an error in the job's format or requests. Instead, call
NWFinishServicingQueueJob2 to remove such a job from the queue.
Also, if a job attempts to access data without proper security clearance and is aborted, the job returns to the end of the queue. To remove such a job from the job queue, call NWFinishServicingQueueJob2.
A job should be aborted only if some temporary internal problem prevents it from completing. For example, a print job might be aborted if the printer has a paper jam. After the paper jam is corrected, the job server can service the job successfully.