Testing Driver Dispatch Routines

Even though a driver may be far from complete when only the DriverEntry, Unload, and Dispatch routines are present, significant code paths can be tested at this point. In particular, all of the following can be verified with a simple Win32 console program:

  • Opens and closes a handle to the device.

  • Supports Win32 I/O function calls that return successfully, even if zero byte transfers are specified.

  • Manages requests from multiple callers.

While the successful completion of these tests is hardly earth-shattering, it does form a tried-and-true recipe for driver authoring: Build a driver framework that is proven before adding hardware interaction.

Testing Procedure

The following procedure checks all the code paths through ...

Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.