Home > Articles > Operating Systems, Server > Microsoft Windows Desktop

Programming Drivers for the UMDF

Previous articles by Ron Reeves, author of Windows 7 Device Driver, looked at Device Driver Objects, Windows Driver Framework, overall architecture of UMDF and major activities and programming approach. This article looks at programming a sample device driver.
Like this article? We recommend ๏”€

Like this article? We recommend

In the previous article โ€œProgramming Approach UMDF Windows 7 Device Drivers,โ€ we looked at the programming approach for developing Windows 7 UMDF Drivers. In this article, we want to look at programming drivers for the UMDF. We will use one of the sample drivers, the Skeleton driver, supplied with the Windows Driver Kit (WDK). As we mentioned in the last article, the UMDF release includes several sample UMDF drivers, one of which is the Skeleton Driver. The Windows Driver Kit has the sample drivers installed at WDF\UMDF\src in the Windows Driver Kit installation directory.

The Skeleton Driver

The Skeleton driver contains the minimum amount of code that is required in a loadable UMDF driver. It was designed as starting point from which to build drivers for actual hardware. In addition to demonstrating the minimal required features and best practices, the Skeleton driver splits into appropriate modules the common code that is required in all UMDF drivers.

The Skeleton driver supports a driver entry point, functions to create and initialize the driver and device callback objects, and functions for COM support. It does not support any I/O or Plug and Play operations. Table 1 lists the component source files.

Table 1โ€”Component Source Files for the Skeleton Driver

Filename

Description

Comsup.cpp

Source code for the CUnknown and CClassFactory classes.

Comsup.h

Header file for COM support functions and classes.

Device.cpp

Source code for the device callback object class CMyDevice.

Device.h

Header file for the device callback object.

Dllsup.cpp

Source code for the driver entry point and exported COM support functions.

Driver.cpp

Source code for the driver callback object class CMyDriver.

Driver.h

Header file for the driver callback object.

Exports.def

Definition file that identifies the library name and exported entry point for driver.

Internal.h

Header file for local type definitions.

Makefile

Generic makefile for building the sample.

Makefile.inc

Additional commands input to the makefile.

Skeleton.htm

Help file that describes the sample.

Skeleton.rc

Resource file for the sample.

Sources

Source file for the build procedure.

UMDF_Skeleton_OSR.inc

INF that installs the Skeleton sample as a driver for the OSR USBFX2 device.

UMDF_Skeleton_OSR_xp.inx

INF that installs the Skeleton sample as a driver for the OSR USBFX2 device on Windows 7.

UMDF_Skeleton_root.inx

INF that installs the Skeleton sample as a driver for a root-enumerated device.

UMDF_Skeleton_root_xp.inx

INF that installs the Skeleton sample as a driver for a root-enumerated device on Windows 7.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.