OSRLogoOSRLogoOSRLogo x Seminar Ad

Everything Windows Driver Development

GoToHomePage xLoginx

    Thu, 14 Mar 2019     118020 members


  Online Dump Analyzer
OSR Dev Blog
The NT Insider
The Basics
File Systems
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

Watch that return from IoSetCompletionRoutineEx

Some of you may already know that there's a new Ex version of IoSetCompletionRoutine that is meant to prevent non-PnP drivers from unloading prematurely. What you might not realize though is that this routine actually returns an NTSTATUS value, which means that you?re going to have to handle the possible error condition.

Another "gotcha" is that IoSetCompletionRoutineEx allocates memory to be used as a context block and this context is not freed until completion processing occurs for the stack location. Therefore, once your driver calls IoSetCompletionRoutineEx the IRP must be passed on to another driver. Otherwise, your completion routine never runs and your driver will leak the pool the I/O Manager allocated.

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

Post Your Comments.
Print this article.
Email this article.
bottom nav links