Initializing Monitors at Spooler Start-up
During its initialization, the spooler does the following for every port and language monitor it finds in the registry:
·Loads the monitor’s DLL.
·Calls the monitor’s InitializePrintMonitor function to obtain its function table. The table is returned as a set of function pointers in a MONITOREX structure. The monitor must initialize pointers to the routines listed in the must-implement section of The Print Monitor API, or the spooler fails the monitor’s creation.
·If the monitor is a port monitor or LMPM, the spooler calls the monitor’s EnumPorts function to obtain the list of ports available on the local machine for printing that this monitor supports.
·For every printer to be added, the spooler calls the associated monitor’s OpenPort or OpenPortEx function to acquire a port handle for every port that has been assigned to that printer.
Once initialization is complete, the spooler has a record of which print monitors and printers exist, and which ports are associated with each monitor and printer. Note that port setup is performed before printers are associated with ports.