Browse Prior Art Database

METHOD OF DETECTING THAT JOBS HAVE BEEN CANCELED IN THE WINDOWS NT SPOOLER, AND OF THEN CANCELING THE JOB ON THE PRINTER

IP.com Disclosure Number: IPCOM000013380D
Original Publication Date: 2000-Jun-01
Included in the Prior Art Database: 2003-Jun-18
Document File: 2 page(s) / 29K

Publishing Venue

IBM

Abstract

Disclosed is a method for a Windows NT 4.0 or Windows 2000 bi-directional port monitor to detect that a job that it is monitoring has been canceled in the system spooler. In this way, the port monitor can then cancel the job on the print device and stop sending status updates to the spooler. (It should be

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 51% of the total text.

Page 1 of 2

  METHOD OF DETECTING THAT JOBS HAVE BEEN CANCELED IN THE WINDOWS NT SPOOLER, AND OF THEN CANCELING THE JOB ON THE PRINTER

   Disclosed is a method for a Windows NT 4.0 or Windows 2000 bi-directional port
monitor to detect that a job that it is monitoring has been canceled in the
system spooler. In this way, the port monitor can then cancel the job on the
print device and stop sending status updates to the spooler. (It should be
stated that even though a Windows NT 4.0 or Windows 2000 bi-directional port
monitor is responsible for monitoring job status for all jobs printed through it,
the spooler does not inform the port monitor that a job it is monitoring has been
canceled. This method addresses this shortcoming.)

The basic method used to discover if a job has been canceled is to perform a
minimal query of the spooler for information about the job (using the Win32
GetJob API with zero-length buffer). If the query fails with error "invalid
parameter", the job has been canceled. To minimize resource use, the GetJob
calls are made from a single always-running thread with algorithm:
do forever
wait until there are active jobs (will return
immediately if there are already active jobs)
sleep for a while (to avoid spinning when there are
active jobs)
for all ports
if the port is being monitored
for all active jobs on that port
if job not deleted or in cancel process already
if GetJob shows the job has been canceled
start separate thread to cancel the job on the printer

It is necessary to start a separate thread to do the
cancellation since the process of doing the cancel on the
printer can be lengthy. This separate thread has the
res...