## Printer Device Driver

[prev][next][parent][TOC]

### Protocol-Converter Extensions

The spooler allows protocol converters to be written that make use of a converter already installed on the system. These are extensions to the base protocol converters, and they are called before the base converter is called to allow the extension converters to handle specific printers better than the base converter.

A protocol extension is installed by writing the following to the system INI file:

    ApplicationName  =  "PM_PROTOCOL_EXTENSION"

    KeyName          =  Name of new protocol converter;  ex: "MYNPAEXT"

    KeyValue         =  Base protocol converter name followed by a comma

                        and the path to this new protocol converter.

                        ex: "NPAP,C:\OS2\DLL\MYNPAEXT.CNV"

The initialization sequence for protocol-converter extensions is as follows :

1.Spooler sends BIDI_Q_PORT to port driver.

2.Spooler determines base converter to use based on PRTPORT structure.

3.Spooler starts BIDI_WAIT_ALERT thread for port driver (if none started for the port driver yet).

4.Spooler sends BIDI_INIT_PROTCNV to base protocol converter.

5.Spooler calls each extension to the base protocol converter with BIDI_ INIT_PROTCNV. If the extension converter supports this specific printer model, it returns 0 for success; otherwise, it returns ERROR_NOT_SUPPORTED.

The spooler uses the first extension to the base protocol converter that returns success. The sequence of calling protocol-converter extensions is indeterminate.

Once an extension converter is loaded for a port, all protocol-converter commands go to the extension converter. The extension converter has the option of calling the base protocol converter to process the command.