Step 1: Minidriver Initialization

There are three stages of minidriver initialization:

Note that the parameters passed to the Enable DDI indicate whether the driver should initialize the GDIINFO structure or the video hardware. Drivers should not rely on the order of the Enable calls.

Init Routine (Before GDI)

The kernel calls the display driver's initialization routine when it first loads the driver. At this point, neither GDI nor USER have been loaded, so no graphics operations are required. Instead, you can carry out initialization procedures that do not affect the display adapter. For an example of init code, see the INIT.ASM file in the display driver samples.

Enable GDIINFO

GDI calls Enable twice whenever it creates or restores a display DC. One of the calls is to get the GDIINFO block from your minidriver. For a code example, see the ENABLE.ASM file in the display driver samples.

You must set the following fields in the GDIINFO structure for your adapter. Do this after using the DIB_Enable function to get the information from the DIB engine:

dpVersion

dpNumBrushes

dpHorzRes

dpNumPens

dpVertRes

dpNumFonts

dpBitsPixel

dpNumColors

dpPlanes


Note that the DIB engine may set capability bits in GDIINFO in addition to those set by the display minidriver. The driver should not modify the bits set by the engine. To achieve this, the driver should use the logical OR operator when setting bits. Minidrivers that do not have an accessible frame buffer should set the NOT_FRAMEBUFFER bit in the deFlags member of the DIBENGINE structure.

If your adapter does not provide a hardware graphics accelerator, set the C1_SLOW_CARD bit in the dpCaps1 member.

When your minidriver has completed initializing the GDIINFO structure, return it to GDI.

Initializing the Hardware

Minidrivers initialize the video hardware and create their PDEVICE structure on one of the calls to Enable. Use the following steps to initialize your hardware:

You now have a generic display minidriver. You need to follow the remaining steps in order to customize your minidriver for your display adapter.