Everhart, Glenn (FUSA) From: Jamie Hanrahan [jeh@cmkrnl.com] Sent: Sunday, May 16, 1999 2:42 AM To: ntdev Subject: RE: [ntdev] [ntfsd] where to complete IRPs (was RE: write timeout ??) > Can you please explain me what you mean completing > IRPs from any DISPATCH_LEVEL routine. I realize the > limitations of the thread, but what is ANY routine ? I mean any routine within your driver that NT invokes at DISPATCH_LEVEL or below. This means just about anything except your ISR or SynchCritSection routines. > > And how does it suit into the following scenario: > > Dispatch->Queue->Pending ... Processing (including user level > interactions)... > > Processing finished ... thread finds IRP in the queue and passes > it through. Well, how does your driver determine that "processing is finished"? If you're a lowest-level driver it's usually the result of an interrupt; if you're not, it's usually an IO completion callback from a lower layer. Other possibilities include an IoTimer or kernel timer, or even notification from a user thread (one IRP from a user-mode thread might tell you to complete an IRP you were holding). In the case of the ISR, you queue a DPC and your DPC routine can call IoCompleteRequest. In all the other cases, the IoTimer routine, or CustomTimerDpc routine, or IoCompletionCallback routine, or Dispatch routine for the new IRP, can simply call IoCompleteRequest. How are you telling your kernel thread that it's time to wake up and complete IRPs? By calling KeSetEvent, perhaps? Well, at that point, you can just call IoCompleteRequest instead. What motivated you to use a thread? --- Jamie Hanrahan, Kernel Mode Systems ( http://www.cmkrnl.com/ ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]