strange IRQL

Home Forums Discussions General Discussion strange IRQL

This topic contains 1 reply, has 2 voices, and was last updated by  Taras 10 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5083

    alex_s
    Participant

    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);

    #6208

    Taras
    Participant

    ObjPtr[0] = &g_pWaitItem->hAllow;
    ObjPtr[1] = &g_pWaitItem->hDeny;

    hAllow, hDeny – are they handle of events? KeWaitForMultipleObjects may operate only with direct pointer to KEVENT struct. If you have handles, you should retrieve direct pointer by call ObReferenceObjectByHandle

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.