IRP_MN_SET_POWER and toaster example
You can have device and system power IRPs active at the same time, but
you won't have (say) a device query and a device set, or a system query
and a system set.
Handling error conditions in the middle of a power IRP is tricky. That's
why I built the elaborate state machine that you'll find in ch. 8 of my
WDM book and why I recommend to my seminar students that they simply
ship their drivers with a personalized copy of the GENERIC.SYS library
contained in the book samples. The PnP and power handling in GENERIC has
been thoroughly tested in many different types of driver at this point.
--
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com
|