GDI from the Driver’s Perspective

GDI is the intermediary support between a Windows NT graphics driver and application. Applications call Win32 GDI functions to make graphics output requests. These requests are routed to GDI. GDI then sends these requests to the appropriate graphics driver, such as a display driver or printer driver. GDI is an NT system-supplied module that cannot be replaced.

GDI communicates with the graphics driver through a set of DDI functions. These functions are identified by their Drv prefix. Information is passed between GDI and the driver through the input/output parameters of these entry points. The driver must support certain DrvXxx functions for GDI to call. The driver supports GDI’s requests by performing the appropriate operations on its associated hardware before returning to GDI.

GDI includes many graphics output capabilities in itself, eliminating the need for the driver to support these capabilities and thereby making it possible to reduce the size of the driver. GDI also exports service functions that the driver can call, further reducing the amount of support the driver must provide. GDI service functions are identified by their Eng prefix, and functions that provide access to GDI-maintained structures have names in the form of XXXOBJ_Xxx.

Figure 2.1 shows this flow of communication.

Figure 2.1    Graphics Driver and GDI Interaction