/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    StorPortMSILock

Domain:

    storport

Rule ID:

    Not Applicable

Description:

    Miniport drivers are required to acquire the MSI spin lock for a message if, 
    and only if, the InterruptSynchronizationMode member of the 
    PORT_CONFIGURATION_INFORMATION (STORPORT) structure is set to InterruptSynchronizePerMessage.
    This rule verifies that calls to StorPortAcquireMSISpinLock are only made if
    the synchronization mode is InterruptSynchronizePerMessage.

Help Link:

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

--*/

#include "ntddk_slic.h"

state 
{
    enum {INIT, COMPLETE} afterHwInitialize = INIT;
}

fun_SP_HW_INITIALIZE.exit 
{ 
    afterHwInitialize = COMPLETE;
}

sdv_CheckMSILock.exit
{
    if ( afterHwInitialize == COMPLETE )
    {
        if (! ($return)) {	
            abort "Miniport must acquire an MSI spin lock for a message only if the sync mode is InterruptSynchronizePerMessage.";
        }
    }
}
