/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    Irql_Protocol_Driver_Function

Domain:

    ndis

Rule ID:

    Not Applicable

Description:

    This rule verifies that Protocol related DDIs are only called at proper IRQL levels.
    Check for the proper IRQL when the function is entering.
    
    Related Rule:

Help Link:

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

--*/



#include "slic_base.h"

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

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

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

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

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

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

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

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

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

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

NdisClOpenAddressFamilyEx.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

NdisCloseAdapterEx.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

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

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

NdisCompleteNetPnPEvent.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

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

NdisDeregisterProtocolDriver.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

NdisMNetPnPEvent.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

NdisOpenAdapterEx.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

NdisRegisterProtocolDriver.entry
{
    if ( sdv_irql_current != PASSIVE_LEVEL ) {
        abort "$fname should only be called at IRQL  = PASSIVE_LEVEL.";
    }
}

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

