successfully.
The Skeleton sample driver is simple so that you can use it to learn the basics of how a UMDF driver
works. It's also a good starting point for implementing a functional driver, because most UMDF drivers
can use most of the code in the Skeleton sample driver with little or no modification. You can add code
incrementally to handle the requirements of your particular device.
Inside
Out?
The Skeleton sample driver is installed with the WDK in the %wdk%\src\umdf
\skeleton folder.
Fx2_Driver This sample is a USB driver that was specifically designed for learning purposes.
The Fx2_Driver works with the OSR USB FX2 Learning Kit device from Open System Resources (OSR),
as described later in this chapter. Fx2_Driver is simple because the device itself is not very complicated.
However, the driver works with a real device and demonstrates a range of basic UMDF features, including
how to handle read, write, and device I/O control requests.
Code from the Fx2_Driver sample driver appears throughout this book in examples to show how UMDF
drivers work. Other samples are also included-in this book and in the WDK-to illustrate features that
Fx2_Driver does not support.
Inside
Out?
Fx2_Driver is located under the %wdk%\src\umdf\usb\fx2_driver folder. Each
subfolder contains a variant of the driver. The driver in the Step1 folder is a minimal
implementation. The Step2 through Step5 folders contain increasingly full-featured
versions of the driver. The Final folder contains the complete driver and is the sample
that is used in this book. The \Exe subfolder contains source code for a simple
console application that can be used to operate the device and exercise the
capabilities of the driver.
About KMDF Samples
The WDK provides many KMDF samples. If you are a new WDF developer, we recommend that you examine
the Toaster and Osrusbfx2 samples, which are used throughout this book. You can examine other samples
for more information about other features that these samples do not use, such as DMA or interrupt handling:
Toaster This software driver simulates the behavior of real devices in Windows.
The Toaster driver is not quite as basic as the Skeleton driver, but nevertheless serves as a useful
starting point for understanding KMDF drivers. The Toaster sample is made up of a collection of related
drivers, including bus, filter, and function drivers.
Inside
Out?
The Toaster sample is located in the %wdk%\src\kmdf\toaster folder. Several
subfolders contain different related drivers. The best place to start is with the function
driver located under %wdk%\src\kmdf\toaster\func.
Two drivers in that subfolder contain a different version of the driver: a basic one named Simple, and a
full-featured version named Featured. The %wdk%\src\kmdf\toaster\exe folder contains the source code
for several test applications that you can use to exercise the driver's capabilities.
Osrusbfx2 This sample is a USB driver built for kernel mode.
Code from the Osrusbfx2 sample driver appears throughout this book in examples to show how KMDF
drivers work. This sample does not demonstrate all of the features of KMDF. The %wdk%\src\kmdf folder
in the WDK contains other samples that illustrate features that Osrusbfx2 does not support.
This sample is the kernel-mode equivalent of Fx2_Driver. It has almost the same capabilities as
Fx2_Driver, and the structure and code are quite similar.
Inside
Out?
Osrusbfx2 is located in %wdk%\src\kmdf\osrusbfx2, which includes six subfolders.
The Step1 through Step5 and the Final folders contain successively more
sophisticated versions of the driver. Each version has similar capabilities to the
corresponding Fx2_Driver version. The \Exe subfolder contains the source code for a
simple test application.
Tip
Use the Osrusbfx2
Page 20