Developing and Debugging Windows Driver Model (WDM) Drivers

3 days lecture + hands-on lab

Target Audience

For Driver Developers, Support Engineers and Software QA Engineers

Description

This course covers the development and debugging of drivers using the native kernel API i.e. the Window Driver Model (WDM). Attendees will learn about authoring and validating .INF files to install WDM drivers, synchronous and asynchronous IRP processing, building and dispatching IRPs, participating in PnP and Power state transitions and interfacing with PCI hardware devices.

In the hands-on labs attendees get an opportunity to develop, install, test and debug drivers that exercise the above interfaces on Windows 7 running inside a Virtual Machine as well as analyze kernel mode crash dumps that pertain to these technologies.

Pre-requisites

Proficiency in "C" programming language
Familiarity with Windows kernel architecture and data structures

Goals

Upon completion of this course attendees would be able to:

Author .INF files to install WDM drivers for hardware or virtual devices.

Implement synchronous IRP processing code in device drivers.

Implement code to queue IRPs, IRP completion routines and IRP cancellation in device drivers.

Understand driver layering concepts.

Implement different mechanisms to build I/O requests and send them to underlying drivers.

Implement entry points in device drivers to handle PnP events like device arrival, graceful and surprise removal, resource allocation and perform queue control based on these events.

Implement power management entry points in device drivers to handle Power events like transition to high power state, transition to lower power state, remote wakeup, idle power notifications and perform queue control based on these events.

Understand the interactions between the PnP and Power management components of the driver. Implement code in the driver to interact with PCI hardware like access device registers through I/O ports and memory, perform interrupt handling and queue DPCs and perform bus master DMA.

Topics

Installing Drivers
.INF Files
Driver Installation
Class and Interface GUIDs
Driver Signing
Driver Ranking
Setup API
Plug and Play Notifications
Driver Installation Tools
I/O Request Processing
Win32 I/O API
Dispatch I/O Routines
Types of I/O Transfers
Synchronous I/O Processing
Asynchronous I/O Processing
IRP Queuing Mechanisms
I/O Cancellation
Cleanup Routines
Driver Layering
Attaching to Device Objects
I/O Request Forwarding
I/O Completion Routines
Pre & Post Processing Requests
Building I/O Requests
Plug and Play
Device Enumeration
PnP Device States
PnP IDs
Handling Device Arrival
Handling Resource Assignment
Handling Query and Cancel IRPs
Handling Resource Rebalancing
Handling Device Removal
Power Management
System & Device Power States
Power Management Support Routines
Handling System & Device Power State Changes
Idle State Power Management
Handling Remote Wakeup
Hardware Interfacing
Hardware Resources
I/O Ports
Adapter Memory
Interrupt Handling
Deferred Procedure Calls
Timers
Work Items
Bus Master DMA