Visual Studio 2010!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Driver Bloopers
By Lynn Greiner

Rate This Article: Add This Article To:

Have you ever written a hardware driver? Here's a few common errors, and how to avoid them.

According to Microsoft, these are the biggest bloopers driver developers make, along with how Windows Driver Foundation (WDF) helps prevent them:

Drivers typically make mistakes in:

  • Handling IRPs for asynchronous I/Os. (Not setting IoMarkIrpPending while pending an IRP)
  • Bugs in their cancellation logic. (Not clearing the cancel routine before completing a request)
  • Synchronizing their I/O request flow with the PNP/PM requests. (Freezing, thawing queues etc.)

WDF solves these issues, says Microsoft, by providing higher levels of abstractions. Queues for asynchronous I/O with built-in cancellation and a complete PNP state machine are integrated with the queues. This means the hard aspects of handling requests, pending them on PNP state changes or canceling the requests in the queue are implemented by Microsoft code and the driver developer does not need to worry about them.

Another area where driver developers commonly make errors is in synchronizing DPC/ISRs with their dispatch routines. WDF provides built-in locking to solve this problem, according to Microsoft.




Discuss Driver Bloopers
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Using Microsoft Visual Studio Articles          >>> More By Lynn Greiner