INF: Do Not Call the Display Driver Directly

ID Number: Q77402

3.00

WINDOWS

Summary:

In general, a Windows application cannot call the Windows display

driver directly to perform graphics primitives. This article details

the reasons this restriction is in place.

More Information:

The Windows display driver communicates with the Graphics Device

Interface (GDI) to perform primitive graphics operations. The

parameters of the entry points (or exported functions) in the display

driver are set up according to the standard interface between GDI and

the display driver. The parameters passed by GDI to the display driver

are only meaningful to GDI and to the display driver. A Windows

application has no way to obtain these parameters. For example, the

parameter most-commonly passed by GDI to the display driver is a

pointer to a structure called PDEVICE. Memory for this structure is

allocated by GDI, and its contents are specified by the display driver

during the driver's initialization. The pointer to the PDEVICE

structure is private to GDI; furthermore, the structure of PDEVICE

varies among display drivers.

To give another example, when a primitive is to be done to a memory

bitmap, instead of passing a pointer to PDEVICE, GDI passes to the

display driver a pointer to a structure; the structure is usually

referred to as a physical bitmap. Note that this physical bitmap

structure is also called "BITMAP"; do not confuse it with the BITMAP

structure defined in the Windows Software Development Kit. Again, this

physical bitmap structure is not designed to be used by a Windows

application. Although the information described in this structure is

somewhat related to the bitmap that the application uses, the pointer

to the physical bitmap structure is private to GDI and cannot be

obtained by the application.