USB Design by Example: A Practical Guide to Building I/O Devices, Second Edition

For those of you who have enjoyed our brief journey into the world of kernel programming, I invite you to stay and look around a little. In this section I explore other device drivers, including some filters. Or you can skip this section and move on to Using a Windows-supplied Device Driver.
I was a little wary including the following material since the realm of device drivers is not very forgiving. Program errors can hang your system. Bad variable declarations can crash your OS. Treat this layer with the same respect that you would a power tool, such as a circular saw it can rip wood much faster than a handsaw, but it can take your arm off just as easily!
To reduce our risk in this world I will use template driver programs developed by Walter Oney and provided with his permission. If you want to learn the theory of filter drivers, and device drivers in general, I recommend that you purchase his book, Programming the Microsoft Windows Driver Model.
My second device driver, LOADEZ.SYS, is actually simpler than the BLOCKIO.SYS example. It is a firmware autoloader for the EZ-USB component. This driver must detect that an EZ-USB based I/O device is being attached to the PC host, and then interrogate this device to discover its VID and PID values. The driver will then download firmware onto this EZ-USB board, depending upon the values of VID_PID. There are many examples in this book,...