I’ve got a bugcheck A while being inside KeWaitForMultipleObjects function with IRQL = 2 (dispatch level). How can it happen ? It can be seen that IRQL is tested before go to wait.
ULONG SignalUser(PUSER_DATA_STRUCT pud)
{
PVOID ObjPtr[2];
NTSTATUS ret_val = 0;
KdPrintEnter((“Enter to %sn”, __FUNCTION__));
if ( KeGetCurrentIrql() > PASSIVE_LEVEL )
{
KdPrintCont((“SignalUser: IRQL > PASSIVE_LEVELn”));
KdPrintReturn((“Return from %sn”, __FUNCTION__));
return 0;
}
if (g_isUserPresent == FALSE)
{
KdPrintCont((“SignalUser: g_isUserPresent == FALSEn”));
KdPrintReturn((“Return from %sn”, __FUNCTION__));
return 0;
}
if (STATUS_SUCCESS != KeWaitForMutexObject(&g_SignalMutex, Executive, KernelMode, FALSE, NULL))
{
KdPrintReturn((“Return from %sn”, __FUNCTION__));
return 0;
}
_BEGIN_BLOCK
RtlCopyMemory(g_pCurrData, pud, sizeof(USER_DATA_STRUCT));
ObjPtr[0] = &g_pWaitItem->hAllow;
ObjPtr[1] = &g_pWaitItem->hDeny;
//inform user space program to read the data
KeSetEvent(g_UserEventObject, 0, FALSE);
// wait for user space to answer
ret_val = KeWaitForMultipleObjects(2, ObjPtr, WaitAny, UserRequest, KernelMode, FALSE, NULL, NULL);