Developing Native Device Drivers

To port Windows CE to a target platform, you must provide device drivers for the devices built into your platform. Some types of devices—such as keyboards, displays, and PC Card sockets—have a custom interface to the operating system. The drivers for these types of devices are called native device drivers because the interfaces they use are specific to Windows CE.

In general, native device drivers are of interest only to original equipment manufacturers (OEMs) who build Windows CE–based platforms. Independent hardware vendors (IHVs) who develop drivers for add-on hardware have no need to design or customize native device drivers. Therefore, the following sections regarding native device drivers are directed primarily to OEMs.

Microsoft defines custom interfaces for each type of native device driver. However, although each type of native device driver has a custom interface, native device drivers present a standard set of functionality for all devices of a particular class. This enables the Windows CE operating system to treat all instances of a particular device class alike, despite any physical differences. For example, many Windows CE–based platforms use some type of LCD panel as their displays. However, there are a wide variety of these panels on the market, which have different operating characteristics, such as resolution, bit depth, memory interleaving, and so on. By making all display drivers conform to the same interface, Windows CE can treat all display devices the same, regardless of the physical differences between the devices themselves.

Typically, OEMs link native device drivers with the Graphics, Windowing, and Events Subsystem (GWES) module when they build custom Windows CE–based platforms. However, there are exceptions; not all native device drivers are linked with GWES during the build process. For example, users install and load some types of native device driver, such as display drivers and printers.

For a Handheld PC (H/PC), sample native device drivers are available for the various device classes built into the platform. These device classes are the following:

If your target platform contains a set of devices different from those on the H/PC, you need to create your own native device drivers for the devices. However, if your platform includes devices similar to those on the H/PC, consider porting the sample native device drivers, which the Windows CE Platform Builder provides, to your platform, rather than developing your own native device drivers. By porting the tested device drivers, you can save time and avoid bugs. Even so, it is not mandatory to use the sample code provided with the Platform Builder for the native device driver or for any other driver model. The Platform Builder supplies driver samples solely as a convenience to help you develop your drivers rapidly.

The following sections provide information about native device drivers to help you use and modify the driver models supplied in the Platform Builder. These sections discuss the following:

Note Directory and paths listed are relative to the root directory of the Platform Builder installation.