When I try to acquire a fast mutex inside a routine invoked from read/write Dispatch routine I get the following error. Is it not valid to introduce wait in Read/Write dispatch routines? Help. Thanks.
ATTEMPTED_SWITCH_FROM_DPC (b8)
A wait operation, attach process, or yield was attempted from a DPC routine.
This is an illegal operation and the stack track will lead to the offending
code and original DPC routine.
Arguments:
Arg1: 818f8300, Original thread which is the cause of the failure
Arg2: 84a5b408, New thread
Arg3: 818f2000, Stack address of the original thread
Arg4: 00000000
Debugging Details:
FAULTING_THREAD: 818f8300
DEFAULT_BUCKET_ID: VISTA_DRIVER_FAULT
BUGCHECK_STR: 0xB8
PROCESS_NAME: System
CURRENT_IRQL: 1b
LAST_CONTROL_TRANSFER: from 818ac9cf to 81890e46
STACK_TEXT:
87653ac0 818ac9cf 00000000 818f8300 84a5b34c nt!KiSwapContext+0x26
87653afc 818bb125 818f8300 00000004 84a5b340 nt!KiSwapThread+0x389
87653b30 818236d8 00000000 ee670000 84bcd002 nt!KeWaitForGate+0x198
87653b48 81876035 84607130 84bcd0e8 8779da84 nt!KiAcquireGuardedMutex+0x53
87653b54 8779da84 3f3f3f3f 3f3f3f3f 3f3f3f3f nt!ExAcquireFastMutex+0x1e
87653bf0 8779e10f 84607130 83ff2008 0c773b80 Myfltr!MyReadWriteLBARange+0xd4
87653c14 87799896 84607130 83ff2008 00000003 Myfltr!MyReadWriteProcess+0x6f
87653c48 87799967 84607130 00000000 8779e760 Myfltr!MyFltrReadWriteIrp+0x106
87653c64 81827f83 84607130 83ff2008 83ff2008 MyFltr!MyFltrReadWrite+0x97