## Virtual Device Driver Reference for OS/2

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

### BIOS INT 17h Emulation

One method DOS applications can use to send data to a printer is to use BIOS interrupt 17h. The VLPT emulates BIOS INT 17h and passes these requests through the file system to the physical parallel port device driver (PLPT) by using the system services VDHOpen, VDHWrite and VDHClose. See VDHOpen. VDHWrite, and VDHClose. These functions are not passed to the BIOS for processing.

The BIOS INT 17h emulation supports three functions:

Print Character. The Print Character function buffers single character requests in the virtual device driver buffer associated with each device in a DOS session. When the buffer becomes full, its contents are sent to the VLPT by using VDHWrite. If the device is not open, the VLPT issues VDHOpen to obtain a file handle and start a printer data stream. See VDHWrite and VDHOpen.

Initialize. The virtual parallel port device driver buffer is sent to the physical parallel port device driver by using VDHWrite. The printer data stream is closed by using VDHClose. See VDHWrite and VDHClose.

When the spooler is enabled, closing the data stream closes the spool file. Any subsequent printing will open a new spool file. The beginning of the spool file contains escape sequences to reset the printer to its power-on defaults. When the spooler is disabled, no initialization of the device takes place.

Read Status. The Read Status function returns the contents of the virtual device status register.

See Printer Close Processing for the possible methods of closing a printer data stream opened with BIOS INT 17h.