/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    UsbContReader

Domain:

    wdf

Rule ID:

    Not Applicable

Description:

    Precondition: isUsbDriver fails. (This rule is for USB drivers only)
	
    This rule verifies that readers are configured correctly within EVT_WDF_DEVICE_PREPARE_HARDWARE by
    WdfUsbTargetPipeConfigContinuousReader.

	Rule diagnostics:
	A continuous reader must be configured in EVT_WDF_DEVICE_PREPARE_HARDWARE.


Help Link:

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

--*/


#include "slic_base.h"

state
{
    enum  {inprepHardwareCallback, notInprepHardwareCallback} s = notInprepHardwareCallback;
}

watch sdv_WdfUsbTargetPipeConfigContinuousReader.entry.$1;
	
fun_WDF_DEVICE_PREPARE_HARDWARE.entry
{
    s=inprepHardwareCallback;
}

fun_WDF_DEVICE_PREPARE_HARDWARE.exit
{
    s=notInprepHardwareCallback;
}

	
	
sdv_WdfUsbTargetPipeConfigContinuousReader.entry
{
    if (s!=inprepHardwareCallback)
    {
        abort "A continuous reader cannot be configured outside of EVT_WDF_DEVICE_PREPARE_HARDWARE.";
    }
    else
    {
        halt;
    }
}
