Like much of Windows CE, the Display Driver Interface (DDI) is a subset of the Windows NT DDI. If you are not familiar with the Windows NT DDI, you may wish to read the display driver sections of the Windows NT Device Driver Kit before writing your Windows CE display driver.
Windows CE uses only the basic graphics engine functions and driver functions from the Windows NT DDI. These differences between Windows CE and Windows NT have the following ramifications on Windows CE display drivers:
All Windows CE display drivers must implement a set of DDI functions which will be called by GDI to initialize the display driver and draw to the display. In addition to the DDI functions there is a set of C++ classes called the Graphics Primitive Engine (GPE) classes which display drivers can use to facilitate hardware acceleration. The sample display driver's implementation of the GPE Classes and their methods perform acceleration for S3Trio64 based display hardware. If your display hardware uses a different video chip set, you can change the implementation of the GPE methods to suit your hardware's capabilities.
Note that using the GPE classes is optional. You could write your display driver without them, at the expense of making your implementations of the DDI functions more complex. Note that the GPE classes as provided by Microsoft require that your display hardware have a flat frame buffer. If your display hardware does not, for example if it uses a fixed-size moveable window to access the whole of display memory, it may be infeasable to use the GPE classes. See Windows CE Display Hardware Recommendations for more information.
Windows CE display drivers differ from normal installable device drivers in a number of ways. The major difference is that they do not themselves expose the stream I/O interface. Therefore, they are not managed by the Device Manager, and so RegisterDevice is never called for them. As a result, there are no special device files or other filesystem entries corresponding to active display drivers. The mechanism by which display drivers are loaded is that an application that needs to use the display driver calls CreateDC with the name of the display driver's .DLL file. This causes Windows CE to load the display driver, and initialize it so that a device context can be returned to the calling application.
However, since display drivers require direct access to the display adapter's frame buffer, they are generally implemented on PC Cards. And in Windows CE, PC Cards require drivers that do expose the stream I/O interface. If you are implementing a display driver on a PC Card, you will also have to create a minimal PC Card driver as explained in Installable Device Drivers. This minimal driver will use the xxx_Init function as a bootstrap to loading and initializing your display driver DLL. The xxx_Init function typically creates registry entries under [HKEY_LOCAL_MACHINE\Drivers\Display\Active]. Applications that need to use your driver can then find the name of its DLL there, and so call CreateDC to load and initialize the display driver. When the PC Card is removed, xxx_Deinit can remove the registry entries created by xxx_Init.