Windows loads a graphics driver when it calls the kernel LoadLibrary function. After loading the driver, Windows initializes the DLL by calling the driver's Enable function. Windows calls this function twice: the first time with a pointer to a GDIINFO structure; the second time with a pointer to a PDEVICE structure. The first structure, GDIINFO, describes the device's capabilities and related metrics (such as the dimension of the display or printable region). The second structure, PDEVICE, contains driver-dependent data (unless the driver is a minidriver).
The overview of display drivers describes a special PDEVICE structure that is required for minidrivers. It is called a DIBENGINE structure. A minidriver must initialize this structure (instead of a private PDEVICE structure) when it processes the second call to the Enable function.
Windows disables a graphics driver when it is no longer needed by the system, when an application deletes a corresponding device or information context, or when it saves a display DC in preparation for switching to a full-screen application. Windows disables the driver by calling the driver's Disable function.
See also Disable, Enable, GDIINFO, PDEVICE