Presentation drivers for monochrome raster devices can use the system's display driver, DISPLAY.DLL, to draw the page image on a bit map. This technique reduces the amount of code in the hardcopy driver and ensures that all devices use the same drawing algorithms.
To use the display driver, the hardcopy driver has to open and manage a display DC. It must do this without invoking the graphics engine (the hardcopy driver has to act as if it were the engine). When an application opens a hardcopy DC, the Enable subfunctions in the hardcopy driver must issue appropriate calls to the Enable subfunctions in the display driver.
Note: This technique works well for IBM display drivers. However, when using OEM display drivers, the use of this technique might result in an incompatibility.
These Enable subfunctions perform the following actions:
Note: In some source code, the name pDCI is used for the ulStateInfo parameter.
Note: In the source code, pInstance might occasionally be referred to as the "magic cookie".
Any Grexxx functions called from the operating system to the DC will enter the hardcopy DC through its dispatch table. Function handling routines in the hardcopy driver monitor the incoming calls and redirect those calls that affect the image through the display DC's dispatch table. When a GreEscape routine for DEVESC_NEWFRAME or DEVESC_ENDDOC is detected, the hardcopy driver transfers the bit-map bits from the display DC to a local buffer and sends them as scan lines or bands to the physical device driver.