/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    IrqlKeDispatchLte

Domain:

    Wdm

Rule ID:

    0x00020011

Description:

    The IrqlKeDispatchLte rule specifies that the driver calls the following 
    kernel routines only when it is executing at IRQL <= DISPATCH_LEVEL:
        KeAcquireSpinLock
        KeCancelTimer
        KeClearEvent
        KeFlushIoBuffers
        KeInitializeDeviceQueue
        KeInitializeTimer
        KeInitializeTimerEx
        KePulseEvent
        KeRaiseIrqlToDpcLevel (x86)
        KeReadStateEvent
        KeReadStateTimer
        KeReleaseMutex
        KeRemoveEntryDeviceQueue
        KeResetEvent
        KeSaveFloatingPointState (x86)
        KeSetTimer
        KeSetTimerEx
        KeInitializeSemaphore

Help Link:

    https://go.microsoft.com/fwlink/?LinkId=216034

--*/


#include "slic_base.h"


KeCancelTimer.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeClearEvent.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}


KeInitializeDeviceQueue.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeInitializeTimer.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeInitializeTimerEx.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KePulseEvent.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeRaiseIrqlToDpcLevel@X86.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeRaiseIrqlToDpcLevel@SDV.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}




KeReadStateEvent.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeReadStateTimer.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeReleaseMutex.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeRemoveEntryDeviceQueue.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeResetEvent.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeSaveFloatingPointState@X86.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}


KeSaveFloatingPointState@SDV.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}


KeSetTimer.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeSetTimerEx.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

[KeAcquireSpinLock,KfAcquireSpinLock@X86].entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

[KfAcquireSpinLock@SDV].entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

KeInitializeSemaphore.entry
{
    if ( SDV_IRQL_ELEVATED_LEVEL(sdv_irql_current) ) {
        abort "$fname should only be called at IRQL <= DISPATCH_LEVEL.";
    }
}

