/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    IrqlIoPassive1

Domain:

    Wdm

Rule ID:

    0x0002000A

Description:

    The IrqlIoPassive1 rule specifies that the driver calls the following 
    routines only when it is executing at IRQL = PASSIVE_LEVEL:
        IoAttachDevice
        IoCreateDevice
        IoCreateDeviceSecure (SDV)
        IoSetDeviceInterfaceState

    The rule also specifies that the driver calls the following routine only 
    when it is executing at IRQL = PASSIVE_LEVEL and IRQL = APC_LEVEL:
        IoBuildDeviceIoControlRequest

Help Link:

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

--*/


#include "slic_base.h"


IoCreateDevice.entry
{
    if ( sdv_irql_current > APC_LEVEL ) {
        abort "$fname should only be called at IRQL <= APC_LEVEL.";
    }
}

[IoCreateDeviceSecure,WdmlibIoCreateDeviceSecure]@SDV.entry
{
    if ( sdv_irql_current > APC_LEVEL ) {
        abort "$fname should only be called at IRQL <= APC_LEVEL.";
    }
}


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

IoBuildDeviceIoControlRequest.entry
{
    if ( sdv_irql_current > APC_LEVEL ) {
        abort "$fname should only be called at IRQL <= APC_LEVEL.";
    }
}

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

