## Presentation Device Driver Reference for OS/2

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

### Mandatory Functions for All Drivers

This section describes those functions that must be supported for all devices. These functions are called through the dispatch table by handling routines in the presentation driver. The dispatch table contains the address of each function that the presentation driver can hook. Initially, when the presentation driver is first loaded, a copy of the default dispatch table is passed to the driver. The presentation driver's Enable routine modifies this copy so that the entries for functions supported in the driver point to the handling routines in the driver. Entries to the table that are to be modified can first be saved by the presentation driver in case they are subsequently needed. The original saved table entries, and those that are not modified, point to the engine-simulation routines for the functions concerned.

Functions listed in the dispatch table fall into two categories:

Functions that the presentation driver must support (mandatory functions)
Functions that are supported by the graphics engine but can be optionally hooked by the presentation driver

Descriptions of the mandatory functions are provided. Each description shows what the handling routine is expected to do, the parameters passed to the routine, and the values that the routine returns. The functions are grouped according to the conditional include sections of the header file:

Attribute functions (INCL_GRE_DEVMISC1)
Bit-map functions (INCL_GRE_BITMAPS)
Color table functions (INCL_GRE_COLORTABLE)
Device functions 2 (INCL_GRE_DEVMISC2)
Device functions 3 (INCL_GRE_DEVMISC3)
GreEscape functions (INCL_GRE_DEVICE)
Line functions (INCL_GRE_LINES, INCL_GRE_SCANS)
Marker functions (INCL_GRE_MARKERS)
Query functions (INCL_GRE_DEVICE)
Text (String) functions (INCL_GRE_STRINGS)

Additional functions that must be supported by presentation drivers for display devices are described in Mandatory Functions for Display Drivers. Hardcopy drivers must also provide some support for these display device functions. This support can be a common routine that returns Successful and posts the warning, PMERR_DEV_FUNC_NOT_INSTALLED.

The level of support provided in the handling routine for a particular function depends on the type of device and the level of support provided for that device. At the minimum, the handling routine must indicate a successful completion.