mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.9 KiB
88 lines
2.9 KiB
BOOL InitializeMonitor(VOID)
|
|
|
|
This routine is called once by the print manager to start the monitor.
|
|
Any one time only initializition by the monitor is done here. For
|
|
the AppleTalk Monitor, we start a thread to capture networked printers.
|
|
|
|
|
|
BOOL AddPort()
|
|
|
|
This routine is called when the user selects 'other...' from the list
|
|
of ports. The AppleTalk Monitor presents a browse dialog to allow
|
|
the user to choose an AppleTalk printer. This dialog is modeled
|
|
after the Macintosh Chooser.
|
|
|
|
|
|
BOOL EnumPorts()
|
|
|
|
This routine is called whenever the print manager needs to determine
|
|
a list of available ports. We gather the data concerning each
|
|
configured port and pass it back.
|
|
|
|
|
|
BOOL DeletePort()
|
|
|
|
This routine is called when the print manager user selects 'Delete'
|
|
from the Details... dialog of the print manager. We remove the
|
|
selected port from the list and release the printer if it is
|
|
captured.
|
|
|
|
ISSUE: Can we guarantee that a job is not in progress for this
|
|
port when the call is made? How long can we take for this call?
|
|
If we have to release the printer, should we queue up a request
|
|
to our captive thread?
|
|
|
|
BOOL ConfigurePort()
|
|
|
|
This routine is called whenever the print manager user presses the
|
|
configure button for one of our ports. The AppleTalk Monitor
|
|
presents a dialog to allow the user to capture or not capture
|
|
the specified printer.
|
|
|
|
|
|
OpenPort()
|
|
|
|
Called by the print manager to establish a connection and to generate
|
|
a handle to the port. The AppleTalk Monitor attempts to PAPOpen the
|
|
printer, and if successful, returns a handle for the port.
|
|
|
|
ISSUES: What should the handle value be? Do we return false if
|
|
someone else has the printer open already? What happens if someone
|
|
tries to open the printer while it's being captured?
|
|
|
|
ClosePort()
|
|
|
|
Not sure the diff between close port and enddocport
|
|
|
|
|
|
ReadPort()
|
|
|
|
This routine is called when the print manager wants to read data
|
|
from the printer. Not sure if this is synchronous or not,
|
|
what we are supposed to do if there is no data to be read, or
|
|
what we are to do if there is more data to be read than the
|
|
specified buffer can hold.
|
|
|
|
|
|
WritePort()
|
|
|
|
This routine is called when the print manager wants to send data
|
|
to a printer. Is it synchronous or asynchronous? What are the
|
|
limits on the buffer sizes? What errors can be returned?
|
|
|
|
|
|
StartDocPort()
|
|
|
|
Called by the print manager at the beginning of a print job.
|
|
The AppleTalk Monitor should reset any job performance counts,
|
|
save a handle to the printer object (and job?) so that job
|
|
status can be updated and that the job can be deleted when
|
|
finished.
|
|
|
|
|
|
EndDocPort()
|
|
|
|
Called by the print manager at the end of the print job.
|
|
The AppleTalk Monitor should mark performance counts as
|
|
valid and store them somewhere as well as change the job
|
|
status to complete and delete the print job.
|