Display Driver Initialization

Although most of display driver initialization is generally the same as that for graphics drivers, there are a few details specific to display drivers. This section presents a brief synopsis of the process. See the Programmer’s Guide for more information about the boot process.

Video miniport and display driver initialization occur after the Windows NT executive and the Win32 subsystem are loaded and initialized. It is USER who opens video miniport driver(s) enabled in the registry and then determines which video miniport driver and display driver pair to use. During this determination, GDI opens all necessary display drivers, based on the information provided by Window Manager. Figure 5.1 shows the basic display driver initialization procedure.

Figure 5.1 Display Driver Initialization

The display driver can obtain a bitmap handle for a surface by calling EngCreateBitmap with a pointer to the device pixels. GDI collects the graphics directly in a bitmap. The display driver calls EngCreateBitmap, allowing the GDI to allocate space for the pixels.

Any existing GDI bitmap handle is a valid surface handle. Before returning a surface, the display driver must associate it with the PDEV, using a call to EngAssociateSurface, specifying which functions it wishes to hook for drawing to the surface. If the surface is engine-managed, GDI can handle any or all drawing operations. If the surface is device-managed, at a minimum, the driver must handle DrvTextOut, DrvStrokePath, and DrvCopyBits.