summaryrefslogtreecommitdiff
path: root/tools/sdv/samples/SDV-FailDriver-WDM
diff options
context:
space:
mode:
authorDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
committerDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
commit97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch)
tree46f3701832d70b420eb0fc0eb93261f9da45db3f /tools/sdv/samples/SDV-FailDriver-WDM
parentef1905bf1e8825bb31120dfb27e0daf3154d859a (diff)
Initial publish
Diffstat (limited to 'tools/sdv/samples/SDV-FailDriver-WDM')
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/ReadMe.md39
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln28
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c285
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.h75
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj156
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters26
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/sdv-user.sdv5
7 files changed, 614 insertions, 0 deletions
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/ReadMe.md b/tools/sdv/samples/SDV-FailDriver-WDM/ReadMe.md
new file mode 100644
index 00000000..4aa553f1
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/ReadMe.md
@@ -0,0 +1,39 @@
+SDV-FailDriver-WDM
+==================
+
+The SDV-FailDriver-WDM sample driver contains intentional code errors that are designed to show the capabilities and features of [Static Driver Verifier](http://msdn.microsoft.com/en-us/library/windows/hardware/ff552808) (SDV). SDV is a static verification tool that systematically analyzes the source code of Windows kernel-mode drivers. SDV is included in the Windows Driver Kit (WDK) and can be run from Microsoft Visual Studio. The sample demonstrates how SDV can find errors in a WDM driver.
+
+**Caution**  These sample drivers contain intentional code errors that are designed to show the capabilities and features of SDV. These sample drivers are not functional and are not intended as examples for real driver development projects.
+
+Run the sample
+--------------
+
+1. In the **Solutions Explorer** window, select the driver project (fail\_driver1).
+
+ From the **Driver** menu, click **Launch Static Driver Verifier…**.
+
+ This opens the Static Driver Verifier application, where you can control, configure, and schedule when Static Driver Verifier performs an analysis.
+
+2. Click the **Rules** tab to select which driver DDI usage rules to verify when you start the analysis.
+
+ Static Driver Verifier detects the type of driver you are analyzing (WDF, WDM, NDIS, or Storport) and selects the default set of rules for your driver type. If this is the first time you are running SDV on your driver, you should run the default rule set. To shorten the amount of time it takes to analyze the fail\_driver1 driver sample, you can select the **Custom rule selection**.
+
+ Use the default rule set, or select **Custom rule selection**, click **Clear All**, and then select the following rules for the WDM fail\_driver1 sample:
+
+ - [CancelSpinLock](http://msdn.microsoft.com/en-us/library/windows/hardware/ff542478)
+ - [IrqlIoApcLte](http://msdn.microsoft.com/en-us/library/windows/hardware/ff547759)
+ - [IrqlKeSetEvent](http://msdn.microsoft.com/en-us/library/windows/hardware/ff547835)
+ - [LowerDriverReturn](http://msdn.microsoft.com/en-us/library/windows/hardware/ff548273)
+ - [SpinLock (WDM)](http://msdn.microsoft.com/en-us/library/windows/hardware/ff551861)
+
+ For information about the rules, see [DDI Compliance Rules](http://msdn.microsoft.com/en-us/library/windows/hardware/ff552840).
+
+3. Start the static analysis. Click the **Main** tab, and click **Start**. When you click **Start**, a message is displayed to let you know that static analysis is scheduled and that the analysis can take a long time to run. Click **OK** to continue.
+
+View and analyze the results
+----------------------------
+
+As the static analysis proceeds, SDV reports the status of the analysis. When the analysis is complete, SDV reports the results and statistics. If the driver fails to satisfy a DDI usage rule, the result is reported as a defect. SDV finds 5 defects in this sample.
+
+To view specific defects in the [Static Driver Verifier Report](http://msdn.microsoft.com/en-us/library/windows/hardware/ff552834), click the Defect in the **Results** pane. This opens the [Trace Viewer](http://msdn.microsoft.com/en-us/library/windows/hardware/ff544659), which displays a trace of the code path to the rule violation. For more information, see [Interpreting Static Driver Verifier Results](http://msdn.microsoft.com/en-us/library/windows/hardware/ff547228).
+
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln b/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln
new file mode 100644
index 00000000..39dedc54
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0
+MinimumVisualStudioVersion = 12.0
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{D993A00C-3449-4EA0-AB30-D76264170B45}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Debug|Win32.Build.0 = Debug|Win32
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Release|Win32.ActiveCfg = Release|Win32
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Release|Win32.Build.0 = Release|Win32
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Debug|x64.ActiveCfg = Debug|x64
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Debug|x64.Build.0 = Debug|x64
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Release|x64.ActiveCfg = Release|x64
+ {D993A00C-3449-4EA0-AB30-D76264170B45}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
new file mode 100644
index 00000000..0aed2564
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c
@@ -0,0 +1,285 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ fail_driver1.c
+
+Abstract:
+
+ This is a sample driver that contains intentionally placed
+ code defects in order to illustrate how Static Driver Verifier
+ works. This driver is not functional and not intended as a
+ sample for real driver development projects.
+
+Environment:
+
+ Kernel mode
+
+--*/
+
+#include "fail_driver1.h"
+
+#define _DRIVER_NAME_ "fail_driver1"
+
+#ifndef __cplusplus
+#pragma alloc_text (INIT, DriverEntry)
+#pragma alloc_text (PAGE, DriverAddDevice)
+#pragma alloc_text (PAGE, DispatchCreate)
+#pragma alloc_text (PAGE, DispatchRead)
+#pragma alloc_text (PAGE, DispatchPower)
+#pragma alloc_text (PAGE, DispatchSystemControl)
+#pragma alloc_text (PAGE, DispatchPnp)
+#pragma alloc_text (PAGE, DriverUnload)
+#endif
+
+NTSTATUS
+DriverEntry(
+ _In_ PDRIVER_OBJECT DriverObject,
+ _In_ PUNICODE_STRING RegistryPath
+ )
+{
+
+ UNREFERENCED_PARAMETER(RegistryPath);
+ DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate;
+ DriverObject->MajorFunction[IRP_MJ_READ] = DispatchRead;
+ DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower;
+ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = DispatchSystemControl;
+ DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
+ DriverObject->DriverExtension->AddDevice = DriverAddDevice;
+ DriverObject->DriverUnload = DriverUnload;
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+DriverAddDevice(
+ _In_ PDRIVER_OBJECT DriverObject,
+ _In_ PDEVICE_OBJECT PhysicalDeviceObject
+ )
+{
+ PDEVICE_OBJECT device;
+ PDEVICE_OBJECT TopOfStack;
+ PDRIVER_DEVICE_EXTENSION extension ;
+ NTSTATUS status;
+
+ UNREFERENCED_PARAMETER(DriverObject);
+ UNREFERENCED_PARAMETER(PhysicalDeviceObject);
+
+ PAGED_CODE();
+
+ status = IoCreateDevice(DriverObject,
+ sizeof(DRIVER_DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_DISK,
+ 0,
+ FALSE,
+ &device
+ );
+ if(status==STATUS_SUCCESS)
+ {
+
+ extension = (PDRIVER_DEVICE_EXTENSION)(device->DeviceExtension);
+
+ TopOfStack = IoAttachDeviceToDeviceStack (
+ device,
+ PhysicalDeviceObject);
+ if (NULL == TopOfStack)
+ {
+ IoDeleteDevice(device);
+ return STATUS_DEVICE_REMOVED;
+ }
+
+
+ IoInitializeDpcRequest(device,DpcForIsrRoutine);
+
+ device->Flags &= ~DO_DEVICE_INITIALIZING;
+
+
+ }
+
+ return status;
+}
+
+NTSTATUS
+DispatchCreate (
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp
+ )
+{
+ KAFFINITY ProcessorMask;
+ PDRIVER_DEVICE_EXTENSION extension ;
+
+ PVOID *badPointer = NULL;
+
+ UNREFERENCED_PARAMETER(DeviceObject);
+ UNREFERENCED_PARAMETER(Irp);
+
+ PAGED_CODE();
+
+
+ ExFreePool(badPointer);
+
+
+ extension = (PDRIVER_DEVICE_EXTENSION)DeviceObject -> DeviceExtension;
+
+ ProcessorMask = (KAFFINITY)1;
+
+ IoConnectInterrupt( &extension->InterruptObject,
+ InterruptServiceRoutine,
+ extension,
+ NULL,
+ extension->ControllerVector,
+ PASSIVE_LEVEL,
+ PASSIVE_LEVEL,
+ LevelSensitive,
+ TRUE,
+ ProcessorMask,
+ TRUE );
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+DispatchRead (
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp
+ )
+{
+ /*
+ This defect is injected for the "SpinLock" rule.
+ */
+ KSPIN_LOCK queueLock;
+ KIRQL oldIrql;
+
+ UNREFERENCED_PARAMETER(DeviceObject);
+ UNREFERENCED_PARAMETER(Irp);
+ PAGED_CODE();
+
+ KeInitializeSpinLock(&queueLock);
+
+
+ KeAcquireSpinLock(&queueLock, &oldIrql);
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+DispatchPower (
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp
+ )
+{
+ NTSTATUS status;
+ PDRIVER_DEVICE_EXTENSION extension = (PDRIVER_DEVICE_EXTENSION)(DeviceObject->DeviceExtension);
+ PAGED_CODE();
+
+
+ IoSetCompletionRoutine(Irp, CompletionRoutine, extension, TRUE, TRUE, TRUE);
+
+ status = IoCallDriver(DeviceObject,Irp);
+ return status;
+}
+
+NTSTATUS
+DispatchSystemControl (
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp
+ )
+{
+ /*
+ This defect is injected for the "CancelSpinLock" rule.
+ */
+ KIRQL oldIrql;
+
+ UNREFERENCED_PARAMETER(DeviceObject);
+ UNREFERENCED_PARAMETER(Irp);
+ PAGED_CODE();
+
+ IoAcquireCancelSpinLock(&oldIrql);
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+DispatchPnp (
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _Inout_ PIRP Irp
+ )
+{
+
+ /*
+ This defect is injected for "LowerDriverReturn" rule.
+ */
+ NTSTATUS status = IoCallDriver(DeviceObject,Irp);
+ PAGED_CODE();
+
+ status = STATUS_SUCCESS;
+ return status;
+}
+
+NTSTATUS
+CompletionRoutine(
+ _In_ PDEVICE_OBJECT DeviceObject,
+ _In_ PIRP Irp,
+ _In_reads_opt_(_Inexpressible_("varies")) PVOID EventIn
+ )
+{
+
+ PKEVENT Event = (PKEVENT)EventIn;
+ KIRQL oldIrql;
+ PDRIVER_DEVICE_EXTENSION extension = (PDRIVER_DEVICE_EXTENSION)(DeviceObject->DeviceExtension);
+ UNREFERENCED_PARAMETER(Irp);
+ _Analysis_assume_(EventIn != NULL);
+ KeRaiseIrql(DISPATCH_LEVEL, &oldIrql);
+
+ /*
+ This defect is injected for IrqlKeSetEvent rule
+ */
+ KeSetEvent(Event, extension->Increment, TRUE);
+ return STATUS_SUCCESS;
+}
+
+BOOLEAN
+InterruptServiceRoutine (
+ _In_ PKINTERRUPT Interrupt,
+ _In_opt_ PVOID DeviceExtensionIn
+ )
+{
+ PDRIVER_DEVICE_EXTENSION DeviceExtension = (PDRIVER_DEVICE_EXTENSION)DeviceExtensionIn;
+ PVOID Context = NULL;
+ _Analysis_assume_(DeviceExtension != NULL);
+ UNREFERENCED_PARAMETER(Interrupt);
+
+ IoRequestDpc(DeviceExtension->DeviceObject, DeviceExtension->Irp, Context);
+ return TRUE;
+}
+
+VOID
+DpcForIsrRoutine(
+ _In_ PKDPC Dpc,
+ _In_ struct _DEVICE_OBJECT *DeviceObject,
+ _Inout_ struct _IRP *Irp,
+ _In_opt_ PVOID Context)
+{
+ UNREFERENCED_PARAMETER(DeviceObject);
+ UNREFERENCED_PARAMETER(Irp);
+ UNREFERENCED_PARAMETER(Context);
+ UNREFERENCED_PARAMETER(Dpc);
+ /*
+ This defect is injected for IrqlIoApcLte rule
+
+ */
+ IoGetInitialStack();
+}
+
+VOID
+DriverUnload(
+ _In_ PDRIVER_OBJECT DriverObject
+ )
+{
+ UNREFERENCED_PARAMETER(DriverObject);
+ PAGED_CODE();
+
+ return;
+}
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.h b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.h
new file mode 100644
index 00000000..854e3217
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.h
@@ -0,0 +1,75 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ fail_driver1.h
+
+Environment:
+
+ Kernel mode
+
+--*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <wdm.h>
+#ifdef __cplusplus
+}
+#endif
+// suppress these warning for this fail_driver
+// SDV can find defects without annotations
+#pragma warning(disable:6387)
+#pragma warning(disable:28166)
+#pragma warning(disable:28165)
+#pragma warning(disable:28121)
+#pragma warning(disable:28150)
+#pragma warning(disable:28160)
+#pragma warning(disable:26135)
+#pragma warning(disable:26165)
+#pragma warning(disable:28930)
+#pragma warning(disable:28931)
+
+typedef struct _DRIVER_DEVICE_EXTENSION
+{
+ PKSPIN_LOCK queueLock;
+ PRKEVENT Event;
+ KPRIORITY Increment;
+ PIRP Irp;
+ PDEVICE_OBJECT DeviceObject;
+ ULONG ControllerVector;
+ PKINTERRUPT InterruptObject;
+}
+DRIVER_DEVICE_EXTENSION,*PDRIVER_DEVICE_EXTENSION;
+
+#ifdef __cplusplus
+extern "C"
+#endif
+DRIVER_INITIALIZE DriverEntry;
+
+DRIVER_ADD_DEVICE DriverAddDevice;
+
+_Dispatch_type_(IRP_MJ_CREATE)
+DRIVER_DISPATCH DispatchCreate;
+
+_Dispatch_type_(IRP_MJ_READ)
+DRIVER_DISPATCH DispatchRead;
+
+_Dispatch_type_(IRP_MJ_POWER)
+DRIVER_DISPATCH DispatchPower;
+
+_Dispatch_type_(IRP_MJ_SYSTEM_CONTROL)
+DRIVER_DISPATCH DispatchSystemControl;
+
+_Dispatch_type_(IRP_MJ_PNP)
+DRIVER_DISPATCH DispatchPnp;
+
+IO_COMPLETION_ROUTINE CompletionRoutine;
+
+KSERVICE_ROUTINE InterruptServiceRoutine;
+
+IO_DPC_ROUTINE DpcForIsrRoutine;
+
+DRIVER_UNLOAD DriverUnload;
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj
new file mode 100644
index 00000000..d4c6a8f3
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{D993A00C-3449-4EA0-AB30-D76264170B45}</ProjectGuid>
+ <RootNamespace>$(MSBuildProjectName)</RootNamespace>
+ <SupportsPackaging>false</SupportsPackaging>
+ <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">Win32</Platform>
+ <SampleGuid>{C9FF3F49-C214-4F1F-90F7-D8E603E8BF77}</SampleGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>False</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>True</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>False</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>True</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <PropertyGroup>
+ <OutDir>$(IntDir)</OutDir>
+ </PropertyGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ItemGroup Label="WrappedTaskItems" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetName>fail_driver1</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>fail_driver1</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetName>fail_driver1</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>fail_driver1</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="fail_driver1.c" />
+ </ItemGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Inf Exclude="@(Inf)" Include="*.inf" />
+ <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
+ <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Exclude="@(None)" Include="*.txt;*.htm;*.html" />
+ <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" />
+ <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+</Project> \ No newline at end of file
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters
new file mode 100644
index 00000000..e1ce9005
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
+ <UniqueIdentifier>{97E7B21F-9D51-46F7-B682-3E296B783754}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ <UniqueIdentifier>{865633FF-0974-4663-BC09-3D6BC8AA2F64}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
+ <UniqueIdentifier>{E11DA589-E084-48A1-8E55-765AB4F1F52E}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Driver Files">
+ <Extensions>inf;inv;inx;mof;mc;</Extensions>
+ <UniqueIdentifier>{02E5F1C3-81C0-4CE8-ADC9-E767C0718594}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="fail_driver1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/sdv-user.sdv b/tools/sdv/samples/SDV-FailDriver-WDM/driver/sdv-user.sdv
new file mode 100644
index 00000000..e651ffe3
--- /dev/null
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/sdv-user.sdv
@@ -0,0 +1,5 @@
+CancelSpinLock
+IrqlIoApcLte
+IrqlKeSetEvent
+LowerDriverReturn
+SpinLock \ No newline at end of file