Passthru problems at Distpatch_Level

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Tojo (Tojo_at_discussions.microsoft.com)
Date: 06/16/04


Date: Wed, 16 Jun 2004 03:02:01 -0700

Hi,

I am using the NDIS IM Passthru driver. I have to redirect the packets to another (Target) driver for processing. I did it by sending IRPs from MPSend and PtReceive functions. User mode applications will also be accessing that Target driver. I used Mutexes to enforce mutual exclusion in access to resources in that driver. However I soon got Bug Checks and Page Faults. The reason was that MPSend often was called at DISPATCH_LEVEL and waiting for mutex at IRQL=2 caused those errors.

The question is why MPSend is called at DISPATCH_LEVEL ? Is there any way to avoid it ? If not, can I wait (for the mutex) at DISPATCH_LEVEL ? (I searched the internet and have concluded that I cannot ). If also not, what should the ioctl handler of the Target Driver do if it gets the IRP containing the packet from MPSend and the mutex is not available. I cannot queue the IRP and return status_pending because that would also mean waiting in MPSend at Dispatch_Level ?

any help from anybody would be appreciated.
thank you.