summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorkarlf <[email protected]>2016-08-11 13:28:13 -0700
committerkarlf <[email protected]>2016-08-11 13:28:13 -0700
commit96eb96dfb613e4c745db6bd1f53a92fe7e2290fc (patch)
treead5f3ede5cbcd6b598677ce41bcf8318471bdd92 /tools
parent687b274aa38fd05c8c26e3068932121876d7f745 (diff)
Updated for "Windows 10 Anniversary Update" (Version 1607)
Diffstat (limited to 'tools')
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/README.md22
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.c1532
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.h175
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.inf88
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.rc12
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/driver.h118
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/public.h174
-rw-r--r--tools/sdv/samples/DV-FailDriver-WDM/wmi.c314
-rw-r--r--tools/sdv/samples/SDV-FailDriver-KMDF/SDV-FailDriver-KMDF.sln46
-rw-r--r--tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj4
-rw-r--r--tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj.Filters8
-rw-r--r--tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj4
-rw-r--r--tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj.Filters8
-rw-r--r--tools/sdv/samples/SDV-FailDriver-NDIS/SDV-FailDriver-NDIS.sln18
-rw-r--r--tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj4
-rw-r--r--tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj.Filters8
-rw-r--r--tools/sdv/samples/SDV-FailDriver-STORPORT/SDV-FailDriver-STORPORT.sln18
-rw-r--r--tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj4
-rw-r--r--tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj.Filters8
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln18
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj4
-rw-r--r--tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters8
22 files changed, 2515 insertions, 80 deletions
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/README.md b/tools/sdv/samples/DV-FailDriver-WDM/README.md
new file mode 100644
index 00000000..aade7dd9
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/README.md
@@ -0,0 +1,22 @@
+DV-FailDriver-WDM
+=================
+
+The DV-FailDriver-WDM sample driver contains intentional code errors that are designed to show the capabilities and features of [Driver Verifier](https://msdn.microsoft.com/en-us/library/windows/hardware/ff545448) (DV) and the [Device Fundamentals tests](https://msdn.microsoft.com/en-us/library/windows/hardware/jj673011). Driver Verifier is a component of the Windows kernel designed to detect drivers that are behaving poorly and stop their execution via a bugcheck; the Device Fundamentals tests are a series of tests provided in the Windows Driver Kit (WDK) designed to provide a good basic set of tests against a driver.
+
+**Caution** This sample driver contains intentional code errors that are designed to show the capabilities and features of DV and SDV. This sample driver is not intended as an example for real driver development projects.
+
+Build the sample for desktop
+--------------
+1. In the **Solutions Explorer** window, select the driver solution (DV-FailDriver-WDM).
+
+2. From the **Build** menu, select **Build Solution**.
+
+Deploy the sample
+--------------
+See [Deploying a Driver to a Test Computer](https://msdn.microsoft.com/en-us/library/windows/hardware/hh454834) for details on how to deploy the sample.
+
+Test the sample
+--------------
+See [How to test a driver at runtime](https://msdn.microsoft.com/en-us/library/windows/hardware/ff554820) for details on how to run tests on the Toastmon driver.
+
+To observe the injected defect being caught by DV, you should enable DV on the Toastmon driver, and then run the "DF - PNP Surprise Remove (Development and Integration)" test on the Toastmon sample driver and device. \ No newline at end of file
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.c b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.c
new file mode 100644
index 00000000..f8c545d2
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.c
@@ -0,0 +1,1532 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+ THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+Module Name:
+
+ defect_toastmon.c
+
+Abstract: This sample is designed to demonstrate the Driver Verifier
+ functionality present in Windows. A bug violating the
+ IrqlPsPassive rule is injected in the ToasterDrvCancelQueuedReadIrps
+ callback. Running the Device Fundamentals PNP Surprise Remove test
+ with Driver Verifier enabled on this Defect_Toastmon driver will create
+ a bugcheck (0xC4) describing the error.
+
+ This driver should not be used as a sample to build a new driver from.
+
+Environment:
+
+ Kernel mode
+
+Revision History:
+
+ Injected defect to demonstrate DV capabilities and cleaned sample
+ (7/14/2015)
+
+ Added module to demonstrate how to register and receive WMI
+ notification in Kernel-mode (3/3/2004)
+
+--*/
+#include "defect_toastmon.h"
+#include <initguid.h>
+#include <wdmguid.h>
+#include "public.h"
+
+#ifdef ALLOC_PRAGMA
+#pragma alloc_text (INIT, DriverEntry)
+#pragma alloc_text (PAGE, Defect_ToastMon_AddDevice)
+#pragma alloc_text (PAGE, Defect_ToastMon_DispatchPnp)
+#pragma alloc_text (PAGE, Defect_ToastMon_DispatchPower)
+#pragma alloc_text (PAGE, Defect_ToastMon_Dispatch)
+#pragma alloc_text (PAGE, Defect_ToastMon_DispatchRead)
+#pragma alloc_text (PAGE, Defect_ToastMon_DispatchSystemControl)
+#pragma alloc_text (PAGE, Defect_ToastMon_Unload)
+#pragma alloc_text (PAGE, Defect_ToastMon_PnpNotifyDeviceChange)
+#pragma alloc_text (PAGE, Defect_ToastMon_PnpNotifyInterfaceChange)
+#pragma alloc_text (PAGE, Defect_ToastMon_GetTargetDevicePdo)
+#pragma alloc_text (PAGE, Defect_ToastMon_OpenTargetDevice)
+#pragma alloc_text (PAGE, Defect_ToastMon_CloseTargetDevice)
+#endif
+
+NTSTATUS
+DriverEntry(
+ __in PDRIVER_OBJECT DriverObject,
+ __in PUNICODE_STRING RegistryPath
+ )
+ //++
+/*
+
+Routine Description:
+
+ Installable driver initialization entry point.
+ This entry point is called directly by the I/O system.
+
+Arguments:
+
+ DriverObject - pointer to the driver object
+
+ RegistryPath - pointer to a unicode string representing the path,
+ to driver-specific key in the registry.
+
+Return Value:
+
+ STATUS_SUCCESS
+
+--*/
+{
+
+ UNREFERENCED_PARAMETER (RegistryPath);
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Entered Driver Entry\n"));
+
+ //
+ // Create dispatch points for the IRPs.
+ //
+
+ DriverObject->MajorFunction[IRP_MJ_CREATE] = Defect_ToastMon_Dispatch;
+ DriverObject->MajorFunction[IRP_MJ_CLOSE] = Defect_ToastMon_Dispatch;
+ DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = Defect_ToastMon_Dispatch;
+ DriverObject->MajorFunction[IRP_MJ_READ] = Defect_ToastMon_DispatchRead;
+ DriverObject->MajorFunction[IRP_MJ_PNP] = Defect_ToastMon_DispatchPnp;
+ DriverObject->MajorFunction[IRP_MJ_POWER] = Defect_ToastMon_DispatchPower;
+ DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
+ Defect_ToastMon_DispatchSystemControl;
+ DriverObject->DriverExtension->AddDevice = Defect_ToastMon_AddDevice;
+ DriverObject->DriverUnload = Defect_ToastMon_Unload;
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+Defect_ToastMon_AddDevice(
+ __in PDRIVER_OBJECT DriverObject,
+ __in PDEVICE_OBJECT PhysicalDeviceObject
+ )
+/*++
+
+Routine Description:
+
+ The Plug & Play subsystem is handing us a brand new PDO, for which we
+ (by means of INF registration) have been asked to provide a driver.
+
+ We need to determine if we need to be in the driver stack for the device.
+ Create a functional device object to attach to the stack
+ Initialize that device object
+ Return status success.
+
+ Remember: we can NOT actually send ANY non pnp IRPS to the given driver
+ stack, UNTIL we have received an IRP_MN_START_DEVICE.
+
+Arguments:
+
+ DeviceObject - pointer to a device object.
+
+ PhysicalDeviceObject - pointer to a device object created by the
+ underlying bus driver.
+
+Return Value:
+
+ NT status code.
+
+--*/
+{
+ NTSTATUS status = STATUS_SUCCESS;
+ PDEVICE_OBJECT deviceObject = NULL;
+ PDEVICE_EXTENSION deviceExtension;
+
+ PAGED_CODE();
+
+ //
+ // Create a device object.
+ //
+
+ status = IoCreateDevice (DriverObject,
+ sizeof (DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_UNKNOWN,
+ FILE_DEVICE_SECURE_OPEN,
+ FALSE,
+ &deviceObject);
+
+
+ if (!NT_SUCCESS (status)) {
+ //
+ // Either not enough memory to create a deviceobject or another
+ // deviceobject with the same name exits. This could happen
+ // if you install another instance of this device.
+ //
+ return status;
+ }
+
+ deviceExtension = (PDEVICE_EXTENSION) deviceObject->DeviceExtension;
+
+ // initialize the device wide spinlock
+ KeInitializeSpinLock(&deviceExtension->deviceSpinlock);
+
+ deviceExtension->TopOfStack = IoAttachDeviceToDeviceStack (
+ deviceObject,
+ PhysicalDeviceObject);
+ if (NULL == deviceExtension->TopOfStack) {
+ IoDeleteDevice(deviceObject);
+ return STATUS_DEVICE_REMOVED;
+ }
+
+ IoInitializeRemoveLock (&deviceExtension->RemoveLock ,
+ DRIVER_TAG,
+ 1, // MaxLockedMinutes
+ 5); // HighWatermark, this parameter is
+ // used only on checked build.
+ //
+ // Set the flag if the device is not holding a pagefile
+ // crashdump file or hibernate file.
+ //
+
+ deviceObject->Flags |= DO_POWER_PAGABLE;
+ deviceObject->Flags |= DO_BUFFERED_IO;
+
+ deviceExtension->DeviceObject = deviceObject;
+ INITIALIZE_PNP_STATE(deviceExtension);
+
+ //
+ // We will keep list of all the toaster devices we
+ // interact with and protect the access to the list
+ // with a mutex.
+ //
+ InitializeListHead(&deviceExtension->DeviceListHead);
+ InitializeListHead(&deviceExtension->RecvQueueHead);
+ ExInitializeFastMutex (&deviceExtension->ListMutex);
+
+ deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Defect_Toastmon: AddDevice: %p to %p->%p \n", deviceObject,
+ deviceExtension->TopOfStack,
+ PhysicalDeviceObject);
+
+ //
+ // Register for TOASTER device interface changes.
+ //
+ // We will get an ARRIVAL callback for every TOASTER device that is
+ // started and a REMOVAL callback for every TOASTER that is removed
+ //
+
+ status = IoRegisterPlugPlayNotification (
+ EventCategoryDeviceInterfaceChange,
+ PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
+ (PVOID)&GUID_DEVINTERFACE_TOASTER,
+ DriverObject,
+ (PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)
+ Defect_ToastMon_PnpNotifyInterfaceChange,
+ (PVOID)deviceExtension,
+#pragma warning(suppress: 6014) // handle is released with unregister call during remove IRP processing
+ &deviceExtension->NotificationHandle);
+
+ if (!NT_SUCCESS(status)) {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "Defect_Toastmon: RegisterPnPNotifiction failed: %x\n", status);
+ }
+
+ RegisterForWMINotification(deviceExtension);
+
+ return STATUS_SUCCESS;
+
+}
+
+NTSTATUS
+Defect_ToastMon_CompletionRoutine(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp,
+ PVOID Context
+ )
+/*++
+
+Routine Description:
+
+ The completion routine for plug & play irps that needs to be
+ processed first by the lower drivers.
+
+Arguments:
+
+ DeviceObject - pointer to a device object.
+
+ Irp - pointer to an I/O Request Packet.
+
+ Context - pointer to an event object.
+
+Return Value:
+
+ NT status code
+
+--*/
+{
+ PKEVENT event;
+
+ event = (PKEVENT) Context;
+
+ UNREFERENCED_PARAMETER(DeviceObject);
+
+ //
+ // If the lower driver didn't return STATUS_PENDING, we don't need to
+ // set the event because we won't be waiting on it.
+ // This optimization avoids grabbing the dispatcher lock and improves perf.
+ //
+ if (Irp->PendingReturned == TRUE) {
+#pragma warning(suppress: 28183)
+ KeSetEvent(event, 0, FALSE);
+ }
+ //
+ // Allows the caller to reuse the IRP
+ //
+ return STATUS_MORE_PROCESSING_REQUIRED;
+}
+
+
+NTSTATUS
+Defect_ToastMon_DispatchPnp (
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+/*++
+
+Routine Description:
+
+ The plug and play dispatch routines.
+
+ Most of these the driver will completely ignore.
+ In all cases it must pass the IRP to the next lower driver.
+
+Arguments:
+
+ DeviceObject - pointer to a device object.
+
+ Irp - pointer to an I/O Request Packet.
+
+Return Value:
+
+ NT status code
+
+--*/
+{
+ PIO_STACK_LOCATION irpStack;
+ NTSTATUS status = STATUS_SUCCESS;
+ KEVENT event;
+ PDEVICE_EXTENSION deviceExtension;
+ PLIST_ENTRY thisEntry;
+ PDEVICE_INFO list;
+
+
+
+
+
+ deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+
+
+
+ irpStack = IoGetCurrentIrpStackLocation(Irp);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Defect_Toastmon: %s IRP:0x%p \n",
+ PnPMinorFunctionString(irpStack->MinorFunction), Irp);
+
+
+ status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
+ if (!NT_SUCCESS (status))
+ {
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ return status;
+ }
+
+
+
+
+
+
+
+ switch (irpStack->MinorFunction) {
+ case IRP_MN_START_DEVICE:
+
+ //
+ // The device is starting.
+ //
+ // We cannot touch the device (send it any non pnp irps) until a
+ // start device has been passed down to the lower drivers.
+ //
+ IoCopyCurrentIrpStackLocationToNext(Irp);
+ KeInitializeEvent(&event,
+ NotificationEvent,
+ FALSE
+ );
+
+ IoSetCompletionRoutine(Irp,
+ (PIO_COMPLETION_ROUTINE)Defect_ToastMon_CompletionRoutine,
+ &event,
+ TRUE,
+ TRUE,
+ TRUE); // No need for Cancel
+
+ status = IoCallDriver(deviceExtension->TopOfStack, Irp);
+
+ if (STATUS_PENDING == status) {
+ KeWaitForSingleObject(
+ &event,
+ Executive, // Waiting for reason of a driver
+ KernelMode, // Waiting in kernel mode
+ FALSE, // No alert
+ NULL); // No timeout
+ status = Irp->IoStatus.Status;
+ }
+
+ if (NT_SUCCESS(status)) {
+
+ SET_NEW_PNP_STATE(deviceExtension, Started);
+ }
+
+ //
+ // We must now complete the IRP, since we stopped it in the
+ // completion routine with STATUS_MORE_PROCESSING_REQUIRED.
+ //
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+
+ case IRP_MN_REMOVE_DEVICE:
+
+
+ //
+ // Wait for all outstanding requests to complete
+ //
+ IoReleaseRemoveLockAndWait(&deviceExtension->RemoveLock, Irp);
+ SET_NEW_PNP_STATE(deviceExtension, Deleted);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoSkipCurrentIrpStackLocation(Irp);
+ status = IoCallDriver(deviceExtension->TopOfStack, Irp);
+
+ //
+ // Unregister the interface notification
+ //
+ IoUnregisterPlugPlayNotification(deviceExtension->NotificationHandle);
+ //
+ // Close all the handles to the target device
+ //
+ ExAcquireFastMutex (&deviceExtension->ListMutex);
+ while(!IsListEmpty(&deviceExtension->DeviceListHead))
+ {
+ thisEntry = RemoveHeadList(&deviceExtension->DeviceListHead);
+ list = CONTAINING_RECORD(thisEntry, DEVICE_INFO, ListEntry);
+ Defect_ToastMon_CloseTargetDevice(list);
+ }
+ ExReleaseFastMutex (&deviceExtension->ListMutex);
+
+ UnregisterForWMINotification(deviceExtension);
+
+ IoDetachDevice(deviceExtension->TopOfStack);
+ IoDeleteDevice(DeviceObject);
+
+ return status;
+
+
+ case IRP_MN_QUERY_STOP_DEVICE:
+ SET_NEW_PNP_STATE(deviceExtension, StopPending);
+ status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MN_CANCEL_STOP_DEVICE:
+
+ //
+ // Check to see whether you have received cancel-stop
+ // without first receiving a query-stop. This could happen if someone
+ // above us fails a query-stop and passes down the subsequent
+ // cancel-stop.
+ //
+
+ if (StopPending == deviceExtension->DevicePnPState)
+ {
+ //
+ // We did receive a query-stop, so restore.
+ //
+ RESTORE_PREVIOUS_PNP_STATE(deviceExtension);
+ }
+ status = STATUS_SUCCESS; // We must not fail this IRP.
+ break;
+
+ case IRP_MN_STOP_DEVICE:
+ SET_NEW_PNP_STATE(deviceExtension, Stopped);
+ status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MN_QUERY_REMOVE_DEVICE:
+
+ SET_NEW_PNP_STATE(deviceExtension, RemovePending);
+ status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MN_SURPRISE_REMOVAL:
+
+
+ SET_NEW_PNP_STATE(deviceExtension, SurpriseRemovePending);
+ ToasterDrvCancelQueuedReadIrps(deviceExtension);
+ status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MN_CANCEL_REMOVE_DEVICE:
+
+ //
+ // Check to see whether you have received cancel-remove
+ // without first receiving a query-remove. This could happen if
+ // someone above us fails a query-remove and passes down the
+ // subsequent cancel-remove.
+ //
+
+ if (RemovePending == deviceExtension->DevicePnPState)
+ {
+ //
+ // We did receive a query-remove, so restore.
+ //
+ RESTORE_PREVIOUS_PNP_STATE(deviceExtension);
+ }
+ status = STATUS_SUCCESS; // We must not fail this IRP.
+ break;
+
+
+ default:
+ //
+ // If you don't handle any IRP you must leave the
+ // status as is.
+ //
+ status = Irp->IoStatus.Status;
+
+ break;
+ }
+
+ //
+ // Pass the IRP down and forget it.
+ //
+ Irp->IoStatus.Status = status;
+ IoSkipCurrentIrpStackLocation (Irp);
+ status = IoCallDriver (deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+}
+
+NTSTATUS
+Defect_ToastMon_DispatchPower(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+/*++
+
+Routine Description:
+
+ This routine is the dispatch routine for power irps.
+ Does nothing except forwarding the IRP to the next device
+ in the stack.
+
+Arguments:
+
+ DeviceObject - Pointer to the device object.
+
+ Irp - Pointer to the request packet.
+
+Return Value:
+
+ NT Status code
+--*/
+{
+ PDEVICE_EXTENSION deviceExtension;
+ PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation(Irp);
+ POWER_STATE_TYPE powerType = stack->Parameters.Power.Type;
+ UCHAR minorFunction = stack->MinorFunction;
+ NTSTATUS status= STATUS_SUCCESS;
+
+ deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+
+ status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
+ if (!NT_SUCCESS (status)) {
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ return status;
+ }
+
+ switch( minorFunction )
+ {
+ case IRP_MN_QUERY_POWER:
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=PoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ break;
+ case IRP_MN_SET_POWER:
+ switch( powerType )
+ {
+ case DevicePowerState:
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=PoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ break;
+ case SystemPowerState:
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=PoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ break;
+ default:
+ status = Irp->IoStatus.Status;
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=PoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ }
+
+ break;
+ default:
+
+ status = Irp->IoStatus.Status;
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=PoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ }
+}
+
+NTSTATUS
+Defect_ToastMon_DispatchSystemControl(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+/*++
+
+Routine Description:
+
+ This routine is the dispatch routine for WMI irps.
+ Does nothing except forwarding the IRP to the next device
+ in the stack.
+
+Arguments:
+
+ DeviceObject - Pointer to the device object.
+
+ Irp - Pointer to the request packet.
+
+Return Value:
+
+ NT Status code
+--*/
+{
+ PDEVICE_EXTENSION deviceExtension;
+ NTSTATUS status= STATUS_SUCCESS;
+
+ deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+ status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
+ if (!NT_SUCCESS (status))
+ {
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ return status;
+ }
+ IoSkipCurrentIrpStackLocation(Irp);
+ status=IoCallDriver(deviceExtension->TopOfStack, Irp);
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+}
+
+
+VOID
+Defect_ToastMon_Unload(
+ __in PDRIVER_OBJECT DriverObject
+ )
+/*++
+
+Routine Description:
+
+ Free all the allocated resources, etc.
+
+Arguments:
+
+ DriverObject - pointer to a driver object.
+
+Return Value:
+
+ VOID.
+
+--*/
+{
+ UNREFERENCED_PARAMETER(DriverObject);
+
+ PAGED_CODE ();
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Entered Defect_ToastMon_Unload\n"));
+
+ return;
+}
+
+NTSTATUS
+Defect_ToastMon_Dispatch(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+
+/*++
+
+Routine Description:
+ This routine is the dispatch handler for the driver. It is responsible
+ for processing the IRPs.
+
+Arguments:
+
+ pDO - Pointer to device object.
+
+ Irp - Pointer to the current IRP.
+
+Return Value:
+
+ STATUS_SUCCESS if the IRP was processed successfully, otherwise an error
+ indicating the reason for failure.
+
+--*/
+
+{
+ PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+ PIO_STACK_LOCATION irpStack;
+ NTSTATUS status;
+
+ Irp->IoStatus.Information = 0;
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Entered Defect_ToastMon_Dispatch\n"));
+
+ status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
+ if (!NT_SUCCESS (status)) {
+ Irp->IoStatus.Information = 0;
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ return status;
+ }
+
+ if (NotStarted == deviceExtension->DevicePnPState)
+ {
+ //
+ // We fail all the IRPs that arrive before the device is started.
+ //
+ Irp->IoStatus.Status = status = STATUS_DEVICE_NOT_READY;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT );
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+ }
+
+ irpStack = IoGetCurrentIrpStackLocation(Irp);
+
+ // Dispatch based on major fcn code.
+
+ switch (irpStack->MajorFunction)
+ {
+ case IRP_MJ_CREATE:
+ case IRP_MJ_CLOSE:
+ // We don't need any special processing on open/close so we'll
+ // just return success.
+ status = STATUS_SUCCESS;
+ break;
+
+ case IRP_MJ_DEVICE_CONTROL:
+ default:
+ status = STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+
+ //
+ // We're done with I/O request. Record the status of the I/O action.
+ //
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT );
+ IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
+ return status;
+}
+
+
+NTSTATUS
+#pragma warning(suppress: 28208)
+Defect_ToastMon_PnpNotifyInterfaceChange(
+ PDEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationStruct,
+ PVOID Context
+ )
+/*++
+
+Routine Description:
+
+ This routine is the PnP "interface change notification" callback routine.
+
+ This gets called on a Toaster triggered device interface arrival or
+ removal.
+ - Interface arrival corresponds to a Toaster device being STARTED
+ - Interface removal corresponds to a Toaster device being REMOVED
+
+ On arrival:
+ - Get the target deviceobject pointer by using the symboliclink.
+ - Get the PDO of the target device, in case you need to set the
+ device parameters of the target device.
+ - Regiter for EventCategoryTargetDeviceChange notification on the fileobject
+ so that you can cleanup whenever associated device is removed.
+
+ On removal:
+ - This callback is a NO-OP for interface removal because we
+ for PnP EventCategoryTargetDeviceChange callbacks and
+ use that callback to clean up when their associated toaster device goes
+ away.
+
+Arguments:
+
+ NotificationStruct - Structure defining the change.
+
+ Context - pointer to the device extension.
+ (supplied as the "context" when we
+ registered for this callback)
+Return Value:
+
+ STATUS_SUCCESS - always, even if something goes wrong
+
+--*/
+{
+ NTSTATUS status = STATUS_SUCCESS;
+ PDEVICE_INFO list = NULL;
+ PDEVICE_EXTENSION deviceExtension = Context;
+ PUNICODE_STRING symbolicLinkName;
+
+ PAGED_CODE();
+
+ symbolicLinkName = NotificationStruct->SymbolicLinkName;
+
+ //
+ // Verify that interface class is a toaster device interface.
+ //
+ // Any other InterfaceClassGuid is an error, but let it go since
+ // it is not fatal to the machine.
+ //
+
+ if ( !IsEqualGUID( (LPGUID)&(NotificationStruct->InterfaceClassGuid),
+ (LPGUID)&GUID_DEVINTERFACE_TOASTER) ) {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, ("Defect_Toastmon: Bad interfaceClassGuid in Defect_ToastMon_PnpNotifyInterfaceChange\n"));
+ return STATUS_SUCCESS;
+ }
+
+ //
+ // Check the callback event.
+ //
+ if (IsEqualGUID( (LPGUID)&(NotificationStruct->Event),
+ (LPGUID)&GUID_DEVICE_INTERFACE_ARRIVAL )) {
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Arrival Notification in Defect_ToastMon_PnpNotifyInterfaceChange\n"));
+
+ //
+ // Allocate memory for the deviceinfo
+ //
+
+ list = ExAllocatePoolWithTag(PagedPool,sizeof(DEVICE_INFO),DRIVER_TAG);
+ if (list == NULL)
+ {
+ goto Error;
+ }
+ RtlZeroMemory(list, sizeof(DEVICE_INFO));
+
+ //
+ // Copy the symbolic link
+ //
+ list->SymbolicLink.MaximumLength = symbolicLinkName->Length +
+ sizeof(UNICODE_NULL);
+ list->SymbolicLink.Length = symbolicLinkName->Length;
+ list->SymbolicLink.Buffer = ExAllocatePoolWithTag (
+ PagedPool,
+ list->SymbolicLink.MaximumLength,
+ DRIVER_TAG);
+ if (list->SymbolicLink.Buffer == NULL)
+ {
+ goto Error;
+ }
+ RtlCopyUnicodeString(&list->SymbolicLink,symbolicLinkName);
+
+ list->DeviceExtension = deviceExtension;
+ InitializeListHead(&list->ListEntry);
+
+ //
+ // Warning: It's not recommended to open the targetdevice
+ // from a pnp notification callback routine, because if
+ // the target device initiates any kind of PnP action as
+ // a result of this open, the PnP manager could deadlock.
+ // You should queue a workitem to do that.
+ // For example, SWENUM devices in conjunction with KS
+ // initiate an enumeration of a device when you do the
+ // open on the device interface.
+ // For simplicity, I'm opening the device here, because
+ // I know the toaster function driver doesn't trigger
+ // any pnp action.
+ // For an example on how to queue a workitem, take a look
+ // at ToasterQueuePassiveLevelCallback in func\featured2\
+ // wake.c file.
+ //
+
+ status = Defect_ToastMon_OpenTargetDevice(list);
+ if (!NT_SUCCESS( status)) {
+ goto Error;
+ }
+
+ //
+ // Finally queue the Deviceinfo.
+ //
+ ExAcquireFastMutex (&deviceExtension->ListMutex);
+ InsertTailList(&deviceExtension->DeviceListHead, &list->ListEntry);
+ ExReleaseFastMutex (&deviceExtension->ListMutex);
+ }
+ else
+ {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Removal Interface Notification\n"));
+ }
+ return STATUS_SUCCESS;
+
+ Error:
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "Defect_Toastmon: PnPNotifyInterfaceChange failed: %x\n", status);
+ Defect_ToastMon_CloseTargetDevice(list);
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+#pragma warning(suppress: 28208)
+Defect_ToastMon_PnpNotifyDeviceChange(
+ PTARGET_DEVICE_REMOVAL_NOTIFICATION NotificationStruct,
+ PVOID Context
+ )
+/*++
+
+Routine Description:
+
+ This routine is the PnP "Device Change Notification" callback routine.
+
+ This gets called on a when the target is query or surprise removed.
+
+ - Interface arrival corresponds to a toaster device being STARTed
+ - Interface removal corresponds to a toaster device being REMOVEd
+
+ On Query_Remove or Remove_Complete:
+ - Find the targetdevice from the list by matching the fileobject pointers.
+ - Dereference the FileObject (this generates a close to the target device)
+ - Free the resources.
+
+Arguments:
+
+ NotificationStruct - Structure defining the change.
+
+ Context - pointer to the device extension.
+ (supplied as the "context" when we
+ registered for this callback)
+Return Value:
+
+ STATUS_SUCCESS - always, even if something goes wrong
+
+--*/
+{
+ NTSTATUS status;
+ PDEVICE_INFO list = Context;
+ PDEVICE_EXTENSION deviceExtension = list->DeviceExtension;
+
+ PAGED_CODE();
+
+ //
+ // if the event is query_remove
+ //
+ if ( (IsEqualGUID( (LPGUID)&(NotificationStruct->Event),
+ (LPGUID)&GUID_TARGET_DEVICE_QUERY_REMOVE))){
+ PTARGET_DEVICE_REMOVAL_NOTIFICATION removalNotification;
+
+#pragma warning(suppress: 28930) // used in assert
+ removalNotification =
+ (PTARGET_DEVICE_REMOVAL_NOTIFICATION)NotificationStruct;
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Device Removal (query remove) Notification\n"));
+
+ ASSERT(list->FileObject == removalNotification->FileObject);
+ //
+ // Deref the fileobject so that we don't prevent
+ // the target device from being removed.
+ //
+ ObDereferenceObject(list->FileObject);
+ list->FileObject = NULL;
+ //
+ // Deref the PDO to compensate for the reference taken
+ // by the bus driver when it returned the PDO in response
+ // to the query-device-relations (target-relations).
+ //
+ ObDereferenceObject(list->Pdo);
+ list->Pdo = NULL;
+ //
+ // We will defer freeing other resources to remove-complete
+ // notification because if query-remove is vetoed, we would reopen
+ // the device in remove-cancelled notification.
+ //
+
+ } else if (IsEqualGUID( (LPGUID)&(NotificationStruct->Event),
+ (LPGUID)&GUID_TARGET_DEVICE_REMOVE_COMPLETE) ) {
+ //
+ // Device is gone. Let us cleanup our resources.
+ //
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Device Removal (remove complete) Notification\n"));
+
+ ExAcquireFastMutex (&deviceExtension->ListMutex);
+ RemoveEntryList(&list->ListEntry);
+ ExReleaseFastMutex (&deviceExtension->ListMutex);
+
+ Defect_ToastMon_CloseTargetDevice(list);
+
+ } else if ( IsEqualGUID( (LPGUID)&(NotificationStruct->Event),
+ (LPGUID)&GUID_TARGET_DEVICE_REMOVE_CANCELLED) ) {
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Device Removal (remove cancelled) Notification\n"));
+
+ // Should be null because we cleared it in query-remove
+
+ ASSERT(!list->FileObject);
+ ASSERT(!list->Pdo);
+
+ //
+ // Unregister the previous notification because when we reopen
+ // the device we will register again on the new fileobject.
+ //
+ IoUnregisterPlugPlayNotification(list->NotificationHandle);
+
+ //
+ // Reopen the device
+ //
+#pragma warning(suppress: 28183)
+ status = Defect_ToastMon_OpenTargetDevice(list);
+ if (!NT_SUCCESS (status)) {
+ //
+ // Couldn't reopen the device. Cleanup.
+ //
+ ExAcquireFastMutex (&deviceExtension->ListMutex);
+ RemoveEntryList(&list->ListEntry);
+ ExReleaseFastMutex (&deviceExtension->ListMutex);
+
+ Defect_ToastMon_CloseTargetDevice(list);
+ }
+
+ } else {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Unknown Device Notification\n"));
+ }
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+Defect_ToastMon_GetTargetDevicePdo(
+ __in PDEVICE_OBJECT DeviceObject,
+ __out PDEVICE_OBJECT *PhysicalDeviceObject
+ )
+/*++
+
+Routine Description:
+
+ This builds and send a pnp irp to get the PDO a device.
+
+Arguments:
+
+ DeviceObject - This is the top of the device in the device stack
+ the irp is to be sent to.
+
+ PhysicalDeviceObject - Address where the PDO pointer is returned
+
+Return Value:
+
+ NT status code
+--*/
+{
+
+ KEVENT event;
+ NTSTATUS status;
+ PIRP irp;
+ IO_STATUS_BLOCK ioStatusBlock;
+ PIO_STACK_LOCATION irpStack;
+ PDEVICE_RELATIONS deviceRelations;
+
+ PAGED_CODE();
+
+ KeInitializeEvent( &event, NotificationEvent, FALSE );
+
+ irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP,
+ DeviceObject,
+ NULL,
+ 0,
+ NULL,
+ &event,
+ &ioStatusBlock );
+
+ if (irp == NULL) {
+ status = STATUS_INSUFFICIENT_RESOURCES;
+ goto End;
+ }
+
+ irpStack = IoGetNextIrpStackLocation( irp );
+ irpStack->MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS;
+ irpStack->Parameters.QueryDeviceRelations.Type = TargetDeviceRelation;
+
+ //
+ // Initialize the status to error in case the bus driver decides not to
+ // set it correctly.
+ //
+
+ irp->IoStatus.Status = STATUS_NOT_SUPPORTED ;
+
+
+ status = IoCallDriver( DeviceObject, irp );
+
+ if (status == STATUS_PENDING) {
+
+ KeWaitForSingleObject( &event, Executive, KernelMode, FALSE, NULL );
+ status = ioStatusBlock.Status;
+ }
+
+ if (NT_SUCCESS( status)) {
+ deviceRelations = (PDEVICE_RELATIONS)ioStatusBlock.Information;
+ ASSERT(deviceRelations);
+ //
+ // You must dereference the PDO when it's no longer
+ // required.
+ //
+ *PhysicalDeviceObject = deviceRelations->Objects[0];
+ ExFreePool(deviceRelations);
+ }
+
+End:
+ return status;
+
+}
+
+NTSTATUS
+Defect_ToastMon_OpenTargetDevice(
+ __in PDEVICE_INFO List
+ )
+/*++
+
+Routine Description:
+
+ Open the target device, get the PDO and register
+ for TargetDeviceChange notification on the fileobject.
+
+Arguments:
+
+
+Return Value:
+
+ NT status code
+--*/
+{
+ NTSTATUS status;
+
+ PAGED_CODE();
+
+ //
+ // Get a pointer to and open a handle to the toaster device
+ //
+
+ status = IoGetDeviceObjectPointer(&List->SymbolicLink,
+ STANDARD_RIGHTS_ALL,
+ &List->FileObject,
+ &List->TargetDeviceObject);
+ if ( !NT_SUCCESS(status) ) {
+ goto Error;
+ }
+
+ //
+ // Register for TargerDeviceChange notification on the fileobject.
+ //
+ status = IoRegisterPlugPlayNotification (
+ EventCategoryTargetDeviceChange,
+ 0,
+ (PVOID)List->FileObject,
+ List->DeviceExtension->DeviceObject->DriverObject,
+ (PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)Defect_ToastMon_PnpNotifyDeviceChange,
+ (PVOID)List,
+ &List->NotificationHandle);
+ if (!NT_SUCCESS (status)) {
+ goto Error;
+ }
+
+ //
+ // Get the PDO. This is required in case you need to set
+ // the target device's parameters using IoOpenDeviceRegistryKey
+ //
+ status = Defect_ToastMon_GetTargetDevicePdo(List->TargetDeviceObject,
+ &List->Pdo);
+ if (!NT_SUCCESS (status)) {
+ goto Error;
+ }
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Defect_Toastmon: Target device Toplevel DO:0x%p and PDO: 0x%p\n",
+ List->TargetDeviceObject, List->Pdo);
+Error:
+
+ return status;
+}
+
+
+__drv_arg(List->SymbolicLink.Buffer, __drv_freesMem(SymLink))
+VOID
+#pragma warning(suppress: 6014)
+Defect_ToastMon_CloseTargetDevice(
+ __in __drv_freesMem(List) PDEVICE_INFO List
+ )
+/*++
+
+Routine Description:
+
+ Close all the handles and free the list.
+
+Arguments:
+
+
+Return Value:
+ VOID
+--*/
+{
+ PAGED_CODE();
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Defect_Toastmon: Closing handle to 0x%p\n", List->TargetDeviceObject);
+ if (List->FileObject){
+ ObDereferenceObject(List->FileObject);
+ }
+ if (List->NotificationHandle) {
+ IoUnregisterPlugPlayNotification(List->NotificationHandle);
+ }
+ if (List->Pdo) {
+ ObDereferenceObject(List->Pdo);
+ }
+ RtlFreeUnicodeString(&List->SymbolicLink);
+ ExFreePool(List);
+}
+
+PCHAR
+PnPMinorFunctionString (
+ __in UCHAR MinorFunction
+)
+{
+ switch (MinorFunction)
+ {
+ case IRP_MN_START_DEVICE:
+ return "IRP_MN_START_DEVICE";
+ case IRP_MN_QUERY_REMOVE_DEVICE:
+ return "IRP_MN_QUERY_REMOVE_DEVICE";
+ case IRP_MN_REMOVE_DEVICE:
+ return "IRP_MN_REMOVE_DEVICE";
+ case IRP_MN_CANCEL_REMOVE_DEVICE:
+ return "IRP_MN_CANCEL_REMOVE_DEVICE";
+ case IRP_MN_STOP_DEVICE:
+ return "IRP_MN_STOP_DEVICE";
+ case IRP_MN_QUERY_STOP_DEVICE:
+ return "IRP_MN_QUERY_STOP_DEVICE";
+ case IRP_MN_CANCEL_STOP_DEVICE:
+ return "IRP_MN_CANCEL_STOP_DEVICE";
+ case IRP_MN_QUERY_DEVICE_RELATIONS:
+ return "IRP_MN_QUERY_DEVICE_RELATIONS";
+ case IRP_MN_QUERY_INTERFACE:
+ return "IRP_MN_QUERY_INTERFACE";
+ case IRP_MN_QUERY_CAPABILITIES:
+ return "IRP_MN_QUERY_CAPABILITIES";
+ case IRP_MN_QUERY_RESOURCES:
+ return "IRP_MN_QUERY_RESOURCES";
+ case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
+ return "IRP_MN_QUERY_RESOURCE_REQUIREMENTS";
+ case IRP_MN_QUERY_DEVICE_TEXT:
+ return "IRP_MN_QUERY_DEVICE_TEXT";
+ case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
+ return "IRP_MN_FILTER_RESOURCE_REQUIREMENTS";
+ case IRP_MN_READ_CONFIG:
+ return "IRP_MN_READ_CONFIG";
+ case IRP_MN_WRITE_CONFIG:
+ return "IRP_MN_WRITE_CONFIG";
+ case IRP_MN_EJECT:
+ return "IRP_MN_EJECT";
+ case IRP_MN_SET_LOCK:
+ return "IRP_MN_SET_LOCK";
+ case IRP_MN_QUERY_ID:
+ return "IRP_MN_QUERY_ID";
+ case IRP_MN_QUERY_PNP_DEVICE_STATE:
+ return "IRP_MN_QUERY_PNP_DEVICE_STATE";
+ case IRP_MN_QUERY_BUS_INFORMATION:
+ return "IRP_MN_QUERY_BUS_INFORMATION";
+ case IRP_MN_DEVICE_USAGE_NOTIFICATION:
+ return "IRP_MN_DEVICE_USAGE_NOTIFICATION";
+ case IRP_MN_SURPRISE_REMOVAL:
+ return "IRP_MN_SURPRISE_REMOVAL";
+ case IRP_MN_QUERY_LEGACY_BUS_INFORMATION:
+ return "IRP_MN_QUERY_LEGACY_BUS_INFORMATION";
+ default:
+ return "unknown_pnp_irp";
+ }
+}
+
+
+NTSTATUS
+Defect_ToastMon_DispatchRead (
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+/*++
+
+Routine Description:
+
+ Performs read from the NIC.
+
+Arguments:
+
+ FdoData - pointer to a FDO_DATA structure
+
+ Irp - pointer to an I/O Request Packet.
+
+Return Value:
+
+ NT status code
+
+
+--*/
+
+{
+ NTSTATUS status;
+ KIRQL oldIrql;
+ BOOLEAN CancelIrp;
+ PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Entered Defect_ToastMon_DispatchRead \n"));
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Attempting to acquire remove lock\n"));
+ status = IoAcquireRemoveLock (&deviceExtension->RemoveLock, Irp);
+ if (!NT_SUCCESS (status))
+ {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, ("Defect_Toastmon: Acquire remove lock failed; the device is already removed\n"));
+ Irp->IoStatus.Information = 0;
+ Irp->IoStatus.Status = status;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ return status;
+ }
+
+
+ KeAcquireSpinLock(&deviceExtension->RecvQueueLock, &oldIrql);
+ CancelIrp = FALSE;
+ //
+ // Since we are queueing the IRP, we should set the cancel routine.
+ //
+ IoSetCancelRoutine(Irp, Defect_ToastmonCancelRoutineForReadIrp);
+
+ //
+ // Let us check to see if the IRP is cancelled at this point.
+ //
+ if(Irp->Cancel!=FALSE)
+ {
+ //
+ // This irp has been marked cancelled. This may have occured
+ // before or after we set the cancel routine. If it occured
+ // before, our cancel routine will not be called and we must
+ // cancel the irp here. If it was cancelled after we set the
+ // cancel routine, the thread that is cancelling the irp will
+ // call our cancel routine. We determine this by setting the
+ // cancel routine to NULL and seeing if the original cancel
+ // routine is still there.
+ //
+
+
+ status = STATUS_CANCELLED;
+ if (IoSetCancelRoutine(Irp, NULL) != NULL)
+ {
+ CancelIrp = TRUE;
+ }
+ }
+ else
+ {
+ //
+ // Queue the IRP and return status pending.
+ //
+ IoMarkIrpPending(Irp);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Defect_ToastMon_DispatchRead - insert the Read Irp into the Recieve Queue and mark IRP as pending \n "));
+ InsertTailList(&deviceExtension->RecvQueueHead,
+ &Irp->Tail.Overlay.ListEntry);
+ status = STATUS_PENDING;
+ //
+ // The IRP shouldn't be accessed after the lock is released
+ // It could be grabbed by another thread or the cancel routine
+ // is running.
+ //
+ }
+
+ KeReleaseSpinLock(&deviceExtension->RecvQueueLock, oldIrql);
+
+ if (CancelIrp != FALSE)
+ {
+ Irp->IoStatus.Status = STATUS_CANCELLED;
+ Irp->IoStatus.Information = 0;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Release the removelock \n"));
+ IoReleaseRemoveLock (&deviceExtension->RemoveLock, Irp);
+ }
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Exiting Defect_ToastMon_DispatchRead \n"));
+ return status;
+}
+
+VOID
+Defect_ToastmonCancelRoutineForReadIrp (
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ )
+
+/*++
+
+Routine Description:
+
+ The cancel routine for IRPs waiting in the RecvQueue.
+ The cancel spin lock is already acquired when this routine is called.
+
+Arguments:
+
+ DeviceObject - pointer to the device object.
+
+ Irp - pointer to the IRP to be cancelled.
+
+
+Return Value:
+
+ VOID.
+
+--*/
+{
+ PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
+ KIRQL oldIrql;
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Canceling Read Request inside Defect_ToastmonCancelRoutineForReadIrp\n"));
+
+ //
+ // Release the cancel spin lock and pass Irp->CancelIrql to
+ // restore the original Irql prior to the call to IoAcquireCancelSpinLock
+ //
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Releasing the cancel spinlock\n"));
+ IoReleaseCancelSpinLock(Irp->CancelIrql);
+
+ //
+ // Acquire the local spinlock and raise the Irql to DISPATCH_LEVEL
+ //
+
+ KeAcquireSpinLock(&deviceExtension->RecvQueueLock, &oldIrql);
+
+ //
+ // Remove the cancelled IRP from queue and release the queue lock.
+ //
+ RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
+
+ //
+ // Release the spinlock and restore the old Irql
+ //
+ KeReleaseSpinLock(&deviceExtension->RecvQueueLock, oldIrql);
+
+ //
+ // Complete the request with STATUS_CANCELLED.
+ //
+
+ Irp->IoStatus.Status = STATUS_CANCELLED;
+ Irp->IoStatus.Information = 0;
+ IoCompleteRequest (Irp, IO_NO_INCREMENT);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Releasing the removelock\n"));
+ IoReleaseRemoveLock (&deviceExtension->RemoveLock, Irp);
+ return;
+
+}
+
+
+VOID
+#pragma warning(suppress: 28167)
+ToasterDrvCancelQueuedReadIrps(
+ PDEVICE_EXTENSION deviceExtension
+ )
+/*++
+
+Routine Description:
+
+ Cancel all the read IRPs waiting in the RecvQueue.
+
+Arguments:
+
+ FdoData - Pointer to the device extension.
+
+Return Value:
+
+ None
+
+--*/
+{
+ KIRQL oldIrql;
+ PIRP irp;
+ PLIST_ENTRY listEntry;
+ ULONG MajorVersion;
+ ULONG MinorVersion;
+ ULONG BuildNumber;
+ BOOLEAN ListEmpty = FALSE;
+
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Canceling queued IRPs inside ToasterDrvCancelQueuedReadIrps"));
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Acquire the RecvQueueLock before checking the RecvQueue as cancellation may also run at the same time"));
+ KeAcquireSpinLock(&deviceExtension->RecvQueueLock, &oldIrql);
+ ListEmpty=IsListEmpty(&deviceExtension->RecvQueueHead);
+ if(ListEmpty)
+ {
+ // injected defect for IrqlPsPassive SDV and DV rule
+#pragma warning(suppress: 28159) // this is the injected defect
+#pragma warning(suppress: 28121)
+ PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
+ KeReleaseSpinLock(&deviceExtension->RecvQueueLock, oldIrql);
+ }
+ else
+ {
+ while(!ListEmpty)
+ {
+ //
+ // Remove a request from the queue.
+ //
+ listEntry = RemoveHeadList(&deviceExtension->RecvQueueHead);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Extracting IRPs from the list."));
+ irp = CONTAINING_RECORD(listEntry, IRP, Tail.Overlay.ListEntry);
+ //
+ // Set the cancel routine to NULL. This is an atomic operation.
+ //
+ if (IoSetCancelRoutine(irp, NULL))
+ {
+ // injected defect for IrqlPsPassive SDV and DV rule
+#pragma warning(suppress: 28159) // this is the injected defect
+#pragma warning(suppress: 28121)
+ PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
+ irp->IoStatus.Status = STATUS_CANCELLED;
+ irp->IoStatus.Information = 0;
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Cancelling the queued IRPs from the list."));
+ KeReleaseSpinLock(&deviceExtension->RecvQueueLock, oldIrql);
+ // do not complete the IRP while holding the lock
+ IoCompleteRequest(irp, IO_NO_INCREMENT);
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, ("Defect_Toastmon: Releasing the removelock."));
+ IoReleaseRemoveLock (&deviceExtension->RemoveLock, irp);
+ KeAcquireSpinLock(&deviceExtension->RecvQueueLock, &oldIrql);
+ }
+ else
+ {
+ //
+ // Cancel rotuine is running. Leave the irp alone.
+ //
+ irp = NULL;
+ }
+ ListEmpty=IsListEmpty(&deviceExtension->RecvQueueHead);
+ if(ListEmpty)
+ {
+ KeReleaseSpinLock(&deviceExtension->RecvQueueLock, oldIrql);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.h b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.h
new file mode 100644
index 00000000..c70d53d8
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.h
@@ -0,0 +1,175 @@
+/*++
+
+Copyright (c) 1990-2000 Microsoft Corporation, All Rights Reserved
+
+Module Name:
+
+ defect_toastmon.h
+
+Abstract:
+
+
+Environment:
+
+ Kernel mode
+
+Revision History:
+
+--*/
+#include <ntddk.h>
+#include <dontuse.h>
+
+#if !defined(__TOASTMON_H__)
+#define __TOASTMON_H__
+
+#define DRIVER_TAG 'NOMT'
+
+#define INITIALIZE_PNP_STATE(_Data_) \
+ (_Data_)->DevicePnPState = NotStarted;\
+ (_Data_)->PreviousPnPState = NotStarted;
+
+#define SET_NEW_PNP_STATE(_Data_, _state_) \
+ (_Data_)->PreviousPnPState = (_Data_)->DevicePnPState;\
+ (_Data_)->DevicePnPState = (_state_);
+
+#define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
+ (_Data_)->DevicePnPState = (_Data_)->PreviousPnPState;\
+//
+// These are the states a PDO or FDO transition upon
+// receiving a specific PnP Irp. Refer to the PnP Device States
+// diagram in DDK documentation for better understanding.
+//
+
+typedef enum _DEVICE_PNP_STATE {
+
+ NotStarted = 0, // Not started yet
+ Started, // Device has received the START_DEVICE IRP
+ StopPending, // Device has received the QUERY_STOP IRP
+ Stopped, // Device has received the STOP_DEVICE IRP
+ RemovePending, // Device has received the QUERY_REMOVE IRP
+ SurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRP
+ Deleted, // Device has received the REMOVE_DEVICE IRP
+ UnKnown // Unknown state
+
+} DEVICE_PNP_STATE;
+
+
+typedef struct _DEVICE_EXTENSION {
+ PDEVICE_OBJECT DeviceObject; // The Defect_ToastMon device object.
+ PDEVICE_OBJECT TopOfStack; // The top of the stack
+ DEVICE_PNP_STATE DevicePnPState; // Track PnP state
+ DEVICE_PNP_STATE PreviousPnPState;
+ IO_REMOVE_LOCK RemoveLock; //
+ KSPIN_LOCK deviceSpinlock; // device wide spinlock
+ PVOID NotificationHandle; // Interface notification handle
+ LIST_ENTRY DeviceListHead; // List to queue the target device info
+ FAST_MUTEX ListMutex; // Synchronize access to DeviceList
+ PVOID WMIDeviceArrivalNotificationObject;
+ LIST_ENTRY RecvQueueHead;
+ KSPIN_LOCK RecvQueueLock;
+ KSPIN_LOCK RcvLock;
+ KSPIN_LOCK ToasterpCancelSpinLock;
+} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
+
+
+typedef struct _DEVICE_INFO {
+ PDEVICE_EXTENSION DeviceExtension; // Our FDO device extension
+ PDEVICE_OBJECT TargetDeviceObject; // Toplevel deviceobject of the target device
+ PDEVICE_OBJECT Pdo; // It's PDO
+ PFILE_OBJECT FileObject;
+ PVOID NotificationHandle; //Device change notification handle
+ LIST_ENTRY ListEntry; // Entry to chain to the listhead
+ UNICODE_STRING SymbolicLink;
+} DEVICE_INFO, *PDEVICE_INFO;
+
+
+#if DBG
+#define DebugPrint(_x_) \
+ DbgPrint ("Defect_ToastMon:"); \
+ DbgPrint _x_;
+
+#define TRAP() DbgBreakPoint()
+
+#else
+#define DebugPrint(_x_)
+#define TRAP()
+#endif
+
+
+/********************* function prototypes ***********************************/
+//
+
+DRIVER_INITIALIZE DriverEntry;
+
+DRIVER_ADD_DEVICE Defect_ToastMon_AddDevice;
+
+__drv_dispatchType(IRP_MJ_CREATE)
+__drv_dispatchType(IRP_MJ_CLOSE)
+__drv_dispatchType(IRP_MJ_DEVICE_CONTROL)
+DRIVER_DISPATCH Defect_ToastMon_Dispatch;
+
+__drv_dispatchType(IRP_MJ_PNP)
+DRIVER_DISPATCH Defect_ToastMon_DispatchPnp;
+
+__drv_dispatchType(IRP_MJ_POWER)
+DRIVER_DISPATCH Defect_ToastMon_DispatchPower;
+
+DRIVER_DISPATCH Defect_ToastMon_StartDevice;
+
+__drv_dispatchType(IRP_MJ_SYSTEM_CONTROL)
+DRIVER_DISPATCH Defect_ToastMon_DispatchSystemControl;
+
+DRIVER_UNLOAD Defect_ToastMon_Unload;
+
+IO_COMPLETION_ROUTINE Defect_ToastMon_CompletionRoutine;
+
+DRIVER_NOTIFICATION_CALLBACK_ROUTINE Defect_ToastMon_PnpNotifyDeviceChange;
+
+DRIVER_NOTIFICATION_CALLBACK_ROUTINE Defect_ToastMon_PnpNotifyInterfaceChange;
+
+NTSTATUS
+Defect_ToastMon_GetTargetDevicePdo(
+ __in PDEVICE_OBJECT DeviceObject,
+ __out PDEVICE_OBJECT* PhysicalDeviceObject
+ );
+
+NTSTATUS
+Defect_ToastMon_OpenTargetDevice(
+ __in PDEVICE_INFO List
+ );
+
+__drv_arg(List->SymbolicLink.Buffer, __drv_freesMem(SymLink))
+VOID
+Defect_ToastMon_CloseTargetDevice(
+ __in __drv_freesMem(List) PDEVICE_INFO List
+ );
+
+PCHAR
+PnPMinorFunctionString (
+ __in UCHAR MinorFunction
+);
+
+NTSTATUS
+RegisterForWMINotification(
+ __in PDEVICE_EXTENSION DeviceExt
+ );
+
+VOID
+UnregisterForWMINotification(
+ __in PDEVICE_EXTENSION DeviceExt
+);
+
+FWMI_NOTIFICATION_CALLBACK WmiNotificationCallback;
+
+
+DRIVER_CANCEL Defect_ToastmonCancelRoutineForReadIrp;
+
+__drv_dispatchType(IRP_MJ_READ)
+DRIVER_DISPATCH Defect_ToastMon_DispatchRead;
+
+VOID
+ToasterDrvCancelQueuedReadIrps(
+ PDEVICE_EXTENSION deviceExtension
+ );
+#endif
+
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.inf b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.inf
new file mode 100644
index 00000000..2cbcf3ed
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.inf
@@ -0,0 +1,88 @@
+;/*++
+;
+;Copyright (c) 1990-2015 Microsoft Corporation All rights Reserved
+;
+;Module Name:
+;
+; Defect_ToastMon.INF
+;
+;Abstract:
+; INF file for installing sample buggy toastmon driver
+;
+;--*/
+
+[Version]
+Signature="$WINDOWS NT$"
+Class=System
+ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318}
+Provider="Sample Provider"
+DriverVer=07/29/2015,10.0.0.0
+CatalogFile=Defect_Toastmon.cat
+
+[DestinationDirs]
+DefaultDestDir = 12
+
+
+; ================= Device Install section =====================
+
+[Manufacturer]
+%MSFT%=MSFT,NTx86, NTamd64, NTARM, NTARM64
+
+; For XP and later
+[MSFT.NTx86]
+%Defect_ToastMon.DRVDESC%=Defect_ToastMon_Inst,root\defect_toastmon
+
+[MSFT.NTARM]
+%Defect_ToastMon.DRVDESC%=Defect_ToastMon_Inst,root\defect_toastmon
+
+[MSFT.NTARM64]
+%Defect_ToastMon.DRVDESC%=Defect_ToastMon_Inst,root\defect_toastmon
+
+[MSFT.NTamd64]
+%Defect_ToastMon.DRVDESC%=Defect_ToastMon_Inst,root\defect_toastmon
+
+[Defect_ToastMon_Inst.NT]
+CopyFiles=Defect_ToastMon.CopyFiles
+
+[Defect_ToastMon.CopyFiles]
+defect_toastmon.sys
+
+[Defect_ToastMon_Inst.NT.Services]
+AddService=Defect_ToastMon,0x00000002,Defect_ToastMon_Service
+
+[Defect_ToastMon_Service]
+DisplayName = %Defect_ToastMon.SVCDESC%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 1 ; SERVICE_SYSTEM_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %12%\defect_toastmon.sys
+
+[DeviceInstall32]
+AddDevice=ROOT\Samples\0001,,ToastMonbuggy
+
+[ToastMonBuggy]
+HardwareIds=root\defect_toastmon
+
+; ================= Source Media Section =====================
+
+[SourceDisksFiles]
+defect_toastmon.sys=1
+
+[SourceDisksNames.x86]
+1 = %DISK_NAME%,,,
+
+[SourceDisksNames.amd64]
+1 = %DISK_NAME%,,,
+
+[SourceDisksNames.ARM]
+1 = %DISK_NAME%,,,
+
+[SourceDisksNames.ARM64]
+1 = %DISK_NAME%,,,
+
+[Strings]
+ClassName = "Sample Drivers"
+Defect_ToastMon.SVCDESC = "Sample ToastMon Buggy Service"
+Defect_ToastMon.DRVDESC = "Sample ToastMon Buggy Driver"
+DISK_NAME = "Toastmon Install Disk"
+
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.rc b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.rc
new file mode 100644
index 00000000..6ae8a2d6
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/defect_toastmon.rc
@@ -0,0 +1,12 @@
+#include <windows.h>
+
+#include <ntverp.h>
+
+#define VER_FILETYPE VFT_DRV
+#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
+#define VER_FILEDESCRIPTION_STR "DV Defect-Injected Toastmon Sample"
+#define VER_INTERNALNAME_STR "defect_toastmon.sys"
+
+#include "common.ver"
+
+
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/driver.h b/tools/sdv/samples/DV-FailDriver-WDM/driver.h
new file mode 100644
index 00000000..0fb84d92
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/driver.h
@@ -0,0 +1,118 @@
+/*++
+Copyright (c) 1990-2015 Microsoft Corporation All Rights Reserved
+
+Module Name:
+
+ driver.h
+
+Abstract:
+
+ This module contains the common declarations for the
+ bus, function and filter drivers.
+
+Author:
+Environment:
+
+ kernel mode only
+
+Notes:
+
+
+Revision History:
+
+
+--*/
+
+//
+// Define an Interface Guid to access the proprietary toaster interface.
+// This guid is used to identify a specific interface in IRP_MN_QUERY_INTERFACE
+// handler.
+//
+
+DEFINE_GUID(GUID_TOASTER_INTERFACE_STANDARD,
+ 0xe0b27630, 0x5434, 0x11d3, 0xb8, 0x90, 0x0, 0xc0, 0x4f, 0xad, 0x51, 0x71);
+// {E0B27630-5434-11d3-B890-00C04FAD5171}
+
+//
+// This guid is used in IoCreateDeviceSecure call to create PDOs. The idea is to
+// allow the administrators to control access to the child device, in case the
+// device gets enumerated as a raw device - no function driver, by modifying the
+// registry. If a function driver is loaded for the device, the system will override
+// the security descriptor specified in the call to IoCreateDeviceSecure with the
+// one specifyied for the setup class of the child device.
+//
+
+DEFINE_GUID(GUID_SD_BUSENUM_PDO,
+ 0x9d3039dd, 0xcca5, 0x4b4d, 0xb3, 0x3d, 0xe2, 0xdd, 0xc8, 0xa8, 0xc5, 0x2e);
+// {9D3039DD-CCA5-4b4d-B33D-E2DDC8A8C52E}
+
+//
+// GUID definition are required to be outside of header inclusion pragma to avoid
+// error during precompiled headers.
+//
+
+#ifndef __DRIVER_H
+#define __DRIVER_H
+
+//
+// Define Interface reference/dereference routines for
+// Interfaces exported by IRP_MN_QUERY_INTERFACE
+//
+
+typedef VOID (*PINTERFACE_REFERENCE)(PVOID Context);
+typedef VOID (*PINTERFACE_DEREFERENCE)(PVOID Context);
+
+typedef
+BOOLEAN
+(*PTOASTER_GET_CRISPINESS_LEVEL)(
+ __in PVOID Context,
+ __out PUCHAR Level
+ );
+
+typedef
+BOOLEAN
+(*PTOASTER_SET_CRISPINESS_LEVEL)(
+ __in PVOID Context,
+ __out UCHAR Level
+ );
+
+typedef
+BOOLEAN
+(*PTOASTER_IS_CHILD_PROTECTED)(
+ __in PVOID Context
+ );
+
+//
+// Interface for getting and setting power level etc.,
+//
+typedef struct _TOASTER_INTERFACE_STANDARD {
+ //
+ // generic interface header
+ //
+ USHORT Size;
+ USHORT Version;
+ PVOID Context;
+ PINTERFACE_REFERENCE InterfaceReference;
+ PINTERFACE_DEREFERENCE InterfaceDereference;
+ //
+ // standard bus interfaces
+ //
+ PTOASTER_GET_CRISPINESS_LEVEL GetCrispinessLevel;
+ PTOASTER_SET_CRISPINESS_LEVEL SetCrispinessLevel;
+ PTOASTER_IS_CHILD_PROTECTED IsSafetyLockEnabled; //):
+} TOASTER_INTERFACE_STANDARD, *PTOASTER_INTERFACE_STANDARD;
+
+#ifndef STATUS_CONTINUE_COMPLETION //required to build driver in Win2K and XP build environment
+//
+// This value should be returned from completion routines to continue
+// completing the IRP upwards. Otherwise, STATUS_MORE_PROCESSING_REQUIRED
+// should be returned.
+//
+#define STATUS_CONTINUE_COMPLETION STATUS_SUCCESS
+
+#endif
+
+#endif
+
+
+
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/public.h b/tools/sdv/samples/DV-FailDriver-WDM/public.h
new file mode 100644
index 00000000..462f28e2
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/public.h
@@ -0,0 +1,174 @@
+/*++
+Copyright (c) 1990-2015 Microsoft Corporation All Rights Reserved
+
+Module Name:
+
+ public.h
+
+Abstract:
+
+ This module contains the common declarations shared by driver
+ and user applications.
+
+Author:
+Environment:
+
+ user and kernel
+Notes:
+
+
+Revision History:
+
+
+--*/
+
+//
+// Define an Interface Guid for bus enumerator class.
+// This GUID is used to register (IoRegisterDeviceInterface)
+// an instance of an interface so that enumerator application
+// can send an ioctl to the bus driver.
+//
+
+DEFINE_GUID (GUID_DEVINTERFACE_BUSENUM_TOASTER,
+ 0xD35F7840, 0x6A0C, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
+// {D35F7840-6A0C-11d2-B841-00C04FAD5171}
+
+//
+// Define an Interface Guid for toaster device class.
+// This GUID is used to register (IoRegisterDeviceInterface)
+// an instance of an interface so that user application
+// can control the toaster device.
+//
+
+DEFINE_GUID (GUID_DEVINTERFACE_TOASTER,
+ 0x781EF630, 0x72B2, 0x11d2, 0xB8, 0x52, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
+//{781EF630-72B2-11d2-B852-00C04FAD5171}
+
+//
+// Define a Setup Class GUID for Toaster Class. This is same
+// as the TOASTSER CLASS guid in the INF files.
+//
+
+DEFINE_GUID (GUID_DEVCLASS_TOASTER,
+ 0xB85B7C50, 0x6A01, 0x11d2, 0xB8, 0x41, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
+//{B85B7C50-6A01-11d2-B841-00C04FAD5171}
+
+//
+// Define a WMI GUID to get busenum info.
+//
+
+DEFINE_GUID (TOASTER_BUS_WMI_STD_DATA_GUID,
+ 0x0006A660, 0x8F12, 0x11d2, 0xB8, 0x54, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
+//{0006A660-8F12-11d2-B854-00C04FAD5171}
+
+//
+// Define a WMI GUID to get toaster device info.
+//
+
+DEFINE_GUID (TOASTER_WMI_STD_DATA_GUID,
+ 0xBBA21300L, 0x6DD3, 0x11d2, 0xB8, 0x44, 0x00, 0xC0, 0x4F, 0xAD, 0x51, 0x71);
+
+//
+// Define a WMI GUID to represent device arrival notification WMIEvent class.
+//
+
+DEFINE_GUID (TOASTER_NOTIFY_DEVICE_ARRIVAL_EVENT,
+ 0x1cdaff1, 0xc901, 0x45b4, 0xb3, 0x59, 0xb5, 0x54, 0x27, 0x25, 0xe2, 0x9c);
+// {01CDAFF1-C901-45b4-B359-B5542725E29C}
+
+
+//
+// GUID definition are required to be outside of header inclusion pragma to avoid
+// error during precompiled headers.
+//
+
+#ifndef __PUBLIC_H
+#define __PUBLIC_H
+
+#define BUS_HARDWARE_IDS L"{B85B7C50-6A01-11d2-B841-00C04FAD5171}\\MsToaster\0"
+#define BUS_HARDWARE_IDS_LENGTH sizeof (BUS_HARDWARE_IDS)
+
+#define BUSENUM_COMPATIBLE_IDS L"{B85B7C50-6A01-11d2-B841-00C04FAD5171}\\MsCompatibleToaster\0"
+#define BUSENUM_COMPATIBLE_IDS_LENGTH sizeof(BUSENUM_COMPATIBLE_IDS)
+
+
+#define FILE_DEVICE_BUSENUM FILE_DEVICE_BUS_EXTENDER
+
+#define BUSENUM_IOCTL(_index_) \
+ CTL_CODE (FILE_DEVICE_BUSENUM, _index_, METHOD_BUFFERED, FILE_READ_DATA)
+
+#define IOCTL_BUSENUM_PLUGIN_HARDWARE BUSENUM_IOCTL (0x0)
+#define IOCTL_BUSENUM_UNPLUG_HARDWARE BUSENUM_IOCTL (0x1)
+#define IOCTL_BUSENUM_EJECT_HARDWARE BUSENUM_IOCTL (0x2)
+#define IOCTL_TOASTER_DONT_DISPLAY_IN_UI_DEVICE BUSENUM_IOCTL (0x3)
+
+//
+// Data structure used in PlugIn and UnPlug ioctls
+//
+#pragma warning(disable:4200)
+typedef struct _BUSENUM_PLUGIN_HARDWARE
+{
+ //
+ // sizeof (struct _BUSENUM_HARDWARE)
+ //
+ __in ULONG Size;
+
+ //
+ // Unique serial number of the device to be enumerated.
+ // Enumeration will be failed if another device on the
+ // bus has the same serail number.
+ //
+
+ __in ULONG SerialNo;
+
+
+ //
+ // An array of (zero terminated wide character strings). The array itself
+ // also null terminated (ie, MULTI_SZ)
+ //
+
+ __in WCHAR HardwareIDs[];
+
+} BUSENUM_PLUGIN_HARDWARE, *PBUSENUM_PLUGIN_HARDWARE;
+#pragma warning(default:4200)
+typedef struct _BUSENUM_UNPLUG_HARDWARE
+{
+ //
+ // sizeof (struct _REMOVE_HARDWARE)
+ //
+
+ __in ULONG Size;
+
+ //
+ // Serial number of the device to be plugged out
+ //
+
+ ULONG SerialNo;
+
+ ULONG Reserved[2];
+
+} BUSENUM_UNPLUG_HARDWARE, *PBUSENUM_UNPLUG_HARDWARE;
+
+typedef struct _BUSENUM_EJECT_HARDWARE
+{
+ //
+ // sizeof (struct _EJECT_HARDWARE)
+ //
+
+ __in ULONG Size;
+
+ //
+ // Serial number of the device to be ejected
+ //
+
+ ULONG SerialNo;
+
+ ULONG Reserved[2];
+
+} BUSENUM_EJECT_HARDWARE, *PBUSENUM_EJECT_HARDWARE;
+
+
+#endif
+
+
+
diff --git a/tools/sdv/samples/DV-FailDriver-WDM/wmi.c b/tools/sdv/samples/DV-FailDriver-WDM/wmi.c
new file mode 100644
index 00000000..ee856d59
--- /dev/null
+++ b/tools/sdv/samples/DV-FailDriver-WDM/wmi.c
@@ -0,0 +1,314 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+ THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+Module Name:
+
+ wmi.c
+
+Abstract: This module demonstrates how to receive WMI notification fired by
+ another driver. The code here basically registers for toaster
+ device arrival WMI notification fired by the toaster function driver.
+ You can use similar technique to receive media sense notification
+ (GUID_NDIS_STATUS_MEDIA_CONNECT/GUID_NDIS_STATUS_MEDIA_DISCONNECT)
+ fired by NDIS whenever the network cable is plugged or unplugged.
+
+
+Environment:
+
+ Kernel mode
+
+Revision History:
+
+--*/
+#include "defect_toastmon.h"
+#include "public.h"
+#include <wmistr.h>
+
+#pragma alloc_text (PAGE, RegisterForWMINotification)
+
+//
+// These typedefs required to avoid compilation errors in Win2K build environment.
+//
+typedef
+VOID
+(*WMI_NOTIFICATION_CALLBACK)( // Copied from WDM.H
+ PVOID Wnode,
+ PVOID Context
+ );
+
+typedef
+NTSTATUS
+(*PFN_IO_WMI_OPEN_BLOCK)(
+ __in GUID *DataBlockGuid,
+ __in ULONG DesiredAccess,
+ __out PVOID *DataBlockObject
+ );
+
+typedef
+NTSTATUS
+(*PFN_IO_WMI_SET_NOTIFICATION_CALLBACK)(
+ __in PVOID Object,
+ __in WMI_NOTIFICATION_CALLBACK Callback,
+ __in PVOID Context
+ );
+
+
+NTSTATUS
+RegisterForWMINotification(
+ __in PDEVICE_EXTENSION DeviceExt
+ )
+{
+ NTSTATUS status = STATUS_SUCCESS;
+ GUID wmiGuid;
+ UNICODE_STRING funcName;
+ PFN_IO_WMI_OPEN_BLOCK WmiOpenBlock = NULL;
+ PFN_IO_WMI_SET_NOTIFICATION_CALLBACK WmiSetNotificationCallback = NULL;
+
+ PAGED_CODE();
+
+// allow pointer casts to functions
+#pragma warning(disable : 4055)
+
+ //
+ // APIs to open WMI interfaces are available on XP and beyond, so let us
+ // first check to see whether there are exported in the kernel we are running
+ // before using them.
+ //
+ RtlInitUnicodeString(&funcName, L"IoWMIOpenBlock");
+ WmiOpenBlock = (PFN_IO_WMI_OPEN_BLOCK) MmGetSystemRoutineAddress(&funcName);
+
+ RtlInitUnicodeString(&funcName, L"IoWMISetNotificationCallback");
+ WmiSetNotificationCallback = (PFN_IO_WMI_SET_NOTIFICATION_CALLBACK) MmGetSystemRoutineAddress(&funcName);
+
+#pragma warning(default : 4055)
+
+ if (WmiOpenBlock == NULL || WmiSetNotificationCallback==NULL) {
+ //
+ // Not available.
+ //
+ return STATUS_NOT_SUPPORTED;
+ }
+
+ //
+ // Check to make sure we are not called multiple times.
+ //
+ if (DeviceExt->WMIDeviceArrivalNotificationObject != NULL) {
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ //
+ // Register WMI callbacks for toaster device arrival events
+ //
+ wmiGuid = TOASTER_NOTIFY_DEVICE_ARRIVAL_EVENT;
+
+ status = WmiOpenBlock(
+ &wmiGuid,
+ WMIGUID_NOTIFICATION,
+ &DeviceExt->WMIDeviceArrivalNotificationObject
+ );
+ if (!NT_SUCCESS(status)) {
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "Unable to open wmi data block status 0x%x\n", status);
+ DeviceExt->WMIDeviceArrivalNotificationObject = NULL;
+
+ } else {
+
+ status = WmiSetNotificationCallback(
+ DeviceExt->WMIDeviceArrivalNotificationObject,
+ WmiNotificationCallback,
+ DeviceExt
+ );
+ if (!NT_SUCCESS(status)) {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "Unable to register for wmi notification 0x%x\n", status);
+ ObDereferenceObject(DeviceExt->WMIDeviceArrivalNotificationObject);
+ DeviceExt->WMIDeviceArrivalNotificationObject = NULL;
+ }
+ }
+
+ return status;
+}
+
+
+VOID
+UnregisterForWMINotification(
+ __in PDEVICE_EXTENSION DeviceExt
+)
+{
+ if (DeviceExt->WMIDeviceArrivalNotificationObject != NULL) {
+ ObDereferenceObject(DeviceExt->WMIDeviceArrivalNotificationObject);
+ DeviceExt->WMIDeviceArrivalNotificationObject = NULL;
+ }
+}
+
+NTSTATUS
+GetDeviceFriendlyName(
+ __in PDEVICE_OBJECT Pdo,
+ __out PUNICODE_STRING DeviceName
+ )
+/*++
+
+Routine Description:
+
+ Return the friendly name associated with the given device object.
+
+Arguments:
+
+Return Value:
+
+ NT status
+
+--*/
+{
+ NTSTATUS status;
+ ULONG resultLength = 0;
+ DEVICE_REGISTRY_PROPERTY property;
+ PWCHAR valueInfo = NULL;
+ ULONG i;
+
+ valueInfo = NULL;
+
+ //
+ // First get the length of the string. If the FriendlyName
+ // is not there then get the lenght of device description.
+ //
+ property = DevicePropertyFriendlyName;
+
+ for (i = 0; i < 2; i++) {
+ status = IoGetDeviceProperty(Pdo,
+ property,
+ 0,
+ NULL,
+ &resultLength);
+
+ if (status != STATUS_BUFFER_TOO_SMALL) {
+ property = DevicePropertyDeviceDescription;
+ }
+ }
+
+ valueInfo = ExAllocatePoolWithTag (NonPagedPool, resultLength,
+ DRIVER_TAG);
+ if (NULL == valueInfo) {
+ status = STATUS_INSUFFICIENT_RESOURCES;
+ goto Error;
+ }
+
+ //
+ // Now we have the right size buffer, we can get the name
+ //
+ status = IoGetDeviceProperty(Pdo,
+ property,
+ resultLength,
+ valueInfo,
+ &resultLength);
+ if (!NT_SUCCESS(status)) {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "IoGetDeviceProperty returned %x\n", status);
+ goto Error;
+ }
+
+#pragma warning(suppress: 26035)
+ RtlInitUnicodeString(DeviceName, valueInfo);
+
+#pragma warning(suppress: 26030)
+ return STATUS_SUCCESS;
+
+Error:
+ if (valueInfo) {
+ ExFreePool(valueInfo);
+ }
+ return (status);
+}
+
+VOID
+WmiNotificationCallback(
+ PVOID Wnode,
+ PVOID Context
+ )
+/*++
+
+Routine Description:
+
+ WMI calls this function to notify the caller that the specified event has occurred.
+
+Arguments:
+
+ Wnode - points to the WNODE_EVENT_ITEM structure returned by the driver triggering the event.
+
+ Context - points to the value specified in the Context parameter of the
+ IoWMISetNotificationCallback routine.
+
+Return Value:
+
+ NT status
+
+--*/
+{
+ PWNODE_SINGLE_INSTANCE wnode = (PWNODE_SINGLE_INSTANCE) Wnode;
+ PDEVICE_EXTENSION deviceExtension = Context;
+ UNICODE_STRING deviceName;
+ PLIST_ENTRY thisEntry, listHead;
+ PDEVICE_INFO list = NULL;
+ PDEVICE_OBJECT devobj;
+ NTSTATUS status;
+ BOOLEAN found = FALSE;
+
+ ExAcquireFastMutex (&deviceExtension->ListMutex);
+
+ listHead = &deviceExtension->DeviceListHead;
+
+ for(thisEntry = listHead->Flink;
+ thisEntry != listHead;
+ thisEntry = thisEntry->Flink)
+ {
+ list = CONTAINING_RECORD(thisEntry, DEVICE_INFO, ListEntry);
+ devobj = list->TargetDeviceObject;
+
+ if (devobj && IoWMIDeviceObjectToProviderId(devobj)
+ == wnode->WnodeHeader.ProviderId) {
+
+ if ( IsEqualGUID( (LPGUID)&(wnode->WnodeHeader.Guid),
+ (LPGUID)&TOASTER_NOTIFY_DEVICE_ARRIVAL_EVENT) ) {
+ //
+ // Currently IRQL level is APC_LEVEL since we have acquired the mutex.
+ // So make sure to release the mutext before doing anything
+ // that can be done only at PASSIVE_LEVEL such as sending PNP
+ // IRPs.
+ //
+ found = TRUE;
+ break;
+
+ } else {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "Unknown event.\n");
+ }
+ }
+
+ }
+
+ ExReleaseFastMutex (&deviceExtension->ListMutex);
+
+ //
+ // Get the friendlyname of the device.
+ //
+ if (found) {
+
+ status = GetDeviceFriendlyName(list->Pdo, &deviceName);
+ if (!NT_SUCCESS(status)) {
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_WARNING_LEVEL, "GetDeviceFriendlyName returned %x\n", status);
+ return;
+ }
+
+ DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "%ws fired a device arrival event\n", deviceName.Buffer);
+ //
+ // Free the memory allocated by GetDeviceFriendlyName.
+ //
+ ExFreePool(deviceName.Buffer);
+ }
+
+ return;
+}
+
diff --git a/tools/sdv/samples/SDV-FailDriver-KMDF/SDV-FailDriver-KMDF.sln b/tools/sdv/samples/SDV-FailDriver-KMDF/SDV-FailDriver-KMDF.sln
index 4f1ca485..759fe2dc 100644
--- a/tools/sdv/samples/SDV-FailDriver-KMDF/SDV-FailDriver-KMDF.sln
+++ b/tools/sdv/samples/SDV-FailDriver-KMDF/SDV-FailDriver-KMDF.sln
@@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{2F812672-CC8D-46A7-9F17-BE94F1A3057C}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{98907926-DADF-4687-825D-E3E9C965FC6A}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Driver", "Driver", "{8A48F8B0-2493-4599-A47C-8B71571F57B7}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Driver", "Driver", "{71ED6564-A24C-4EF8-82F7-D2C6A31E08D8}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_library1", "library\fail_library1.vcxproj", "{461FB63C-938B-43CE-9796-2505F37E8724}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_library1", "library\fail_library1.vcxproj", "{1C5066A8-78E0-4D09-980E-396C9E2BE561}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{E9A28DB1-2600-42AD-BF1C-7A23223C3D40}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{A94E548F-266D-4261-8971-1C075CB22041}"
ProjectSection(ProjectDependencies) = postProject
- {461FB63C-938B-43CE-9796-2505F37E8724} = {461FB63C-938B-43CE-9796-2505F37E8724}
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561} = {1C5066A8-78E0-4D09-980E-396C9E2BE561}
EndProjectSection
EndProject
Global
@@ -22,28 +22,28 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {461FB63C-938B-43CE-9796-2505F37E8724}.Debug|Win32.ActiveCfg = Debug|Win32
- {461FB63C-938B-43CE-9796-2505F37E8724}.Debug|Win32.Build.0 = Debug|Win32
- {461FB63C-938B-43CE-9796-2505F37E8724}.Release|Win32.ActiveCfg = Release|Win32
- {461FB63C-938B-43CE-9796-2505F37E8724}.Release|Win32.Build.0 = Release|Win32
- {461FB63C-938B-43CE-9796-2505F37E8724}.Debug|x64.ActiveCfg = Debug|x64
- {461FB63C-938B-43CE-9796-2505F37E8724}.Debug|x64.Build.0 = Debug|x64
- {461FB63C-938B-43CE-9796-2505F37E8724}.Release|x64.ActiveCfg = Release|x64
- {461FB63C-938B-43CE-9796-2505F37E8724}.Release|x64.Build.0 = Release|x64
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Debug|Win32.ActiveCfg = Debug|Win32
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Debug|Win32.Build.0 = Debug|Win32
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Release|Win32.ActiveCfg = Release|Win32
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Release|Win32.Build.0 = Release|Win32
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Debug|x64.ActiveCfg = Debug|x64
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Debug|x64.Build.0 = Debug|x64
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Release|x64.ActiveCfg = Release|x64
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40}.Release|x64.Build.0 = Release|x64
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Debug|Win32.Build.0 = Debug|Win32
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Release|Win32.ActiveCfg = Release|Win32
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Release|Win32.Build.0 = Release|Win32
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Debug|x64.ActiveCfg = Debug|x64
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Debug|x64.Build.0 = Debug|x64
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Release|x64.ActiveCfg = Release|x64
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561}.Release|x64.Build.0 = Release|x64
+ {A94E548F-266D-4261-8971-1C075CB22041}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A94E548F-266D-4261-8971-1C075CB22041}.Debug|Win32.Build.0 = Debug|Win32
+ {A94E548F-266D-4261-8971-1C075CB22041}.Release|Win32.ActiveCfg = Release|Win32
+ {A94E548F-266D-4261-8971-1C075CB22041}.Release|Win32.Build.0 = Release|Win32
+ {A94E548F-266D-4261-8971-1C075CB22041}.Debug|x64.ActiveCfg = Debug|x64
+ {A94E548F-266D-4261-8971-1C075CB22041}.Debug|x64.Build.0 = Debug|x64
+ {A94E548F-266D-4261-8971-1C075CB22041}.Release|x64.ActiveCfg = Release|x64
+ {A94E548F-266D-4261-8971-1C075CB22041}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {461FB63C-938B-43CE-9796-2505F37E8724} = {2F812672-CC8D-46A7-9F17-BE94F1A3057C}
- {E9A28DB1-2600-42AD-BF1C-7A23223C3D40} = {8A48F8B0-2493-4599-A47C-8B71571F57B7}
+ {1C5066A8-78E0-4D09-980E-396C9E2BE561} = {98907926-DADF-4687-825D-E3E9C965FC6A}
+ {A94E548F-266D-4261-8971-1C075CB22041} = {71ED6564-A24C-4EF8-82F7-D2C6A31E08D8}
EndGlobalSection
EndGlobal
diff --git a/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj b/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj
index ce32e45a..d8c4ccaa 100644
--- a/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj
+++ b/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj
@@ -19,13 +19,13 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{E9A28DB1-2600-42AD-BF1C-7A23223C3D40}</ProjectGuid>
+ <ProjectGuid>{A94E548F-266D-4261-8971-1C075CB22041}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<KMDF_VERSION_MAJOR>1</KMDF_VERSION_MAJOR>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{F91F2992-C128-4959-BE63-E59F6C8D44D8}</SampleGuid>
+ <SampleGuid>{8ACA1472-63DF-4776-9BAC-7B81AA0375F4}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj.Filters b/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj.Filters
index 00a963fc..217729c9 100644
--- a/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj.Filters
+++ b/tools/sdv/samples/SDV-FailDriver-KMDF/driver/fail_driver1.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{BDEC6820-D3F9-4DC1-87F5-BD0F935536B2}</UniqueIdentifier>
+ <UniqueIdentifier>{2308618F-45BA-4027-A3A3-542D6D1A63B3}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{BDD5901A-4251-456A-816A-6C6FFADC38D5}</UniqueIdentifier>
+ <UniqueIdentifier>{64DBECF2-E204-40F4-B178-169D7D6AAF10}</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>{2218C1EA-513A-4DDF-9631-82EA8C353ADC}</UniqueIdentifier>
+ <UniqueIdentifier>{E194CCD9-9835-4D3C-A4AF-702802ACCF6C}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{0D3B16A6-3CC7-465B-A266-F00AC3407943}</UniqueIdentifier>
+ <UniqueIdentifier>{43C25D82-37C8-4D41-99A0-9F904F21B6C8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj b/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj
index 545e0d15..49e4a00e 100644
--- a/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj
+++ b/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj
@@ -19,13 +19,13 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{461FB63C-938B-43CE-9796-2505F37E8724}</ProjectGuid>
+ <ProjectGuid>{1C5066A8-78E0-4D09-980E-396C9E2BE561}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<KMDF_VERSION_MAJOR>1</KMDF_VERSION_MAJOR>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{CBE71F3B-63FA-4DE1-9FAC-0F7C113325EC}</SampleGuid>
+ <SampleGuid>{7E84106C-04C0-4DC5-89B4-7A796AAE9AC6}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj.Filters b/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj.Filters
index ce47299f..102ff304 100644
--- a/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj.Filters
+++ b/tools/sdv/samples/SDV-FailDriver-KMDF/library/fail_library1.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{6FE3B3C4-F73A-4549-9F90-E44F01741516}</UniqueIdentifier>
+ <UniqueIdentifier>{3A108764-3BF9-47DA-94C6-BD82BC4DD7FA}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{8C547F1D-BE78-45EA-94A8-5F705073A926}</UniqueIdentifier>
+ <UniqueIdentifier>{DB754F38-71B8-4421-AD32-12EFC49A06EF}</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>{F1C2EE91-02D0-4115-99E6-CF2EC17F8366}</UniqueIdentifier>
+ <UniqueIdentifier>{1183B99F-6D32-4355-A06A-B02DAB21CD5C}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{4CFEF03D-648E-4550-B830-4951C798107A}</UniqueIdentifier>
+ <UniqueIdentifier>{A227E305-7DE5-403A-A92B-BE3F34AFB937}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/tools/sdv/samples/SDV-FailDriver-NDIS/SDV-FailDriver-NDIS.sln b/tools/sdv/samples/SDV-FailDriver-NDIS/SDV-FailDriver-NDIS.sln
index b1cee396..c0d74da6 100644
--- a/tools/sdv/samples/SDV-FailDriver-NDIS/SDV-FailDriver-NDIS.sln
+++ b/tools/sdv/samples/SDV-FailDriver-NDIS/SDV-FailDriver-NDIS.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdvmp", "driver\sdvmp.vcxproj", "{E6EA3861-2C59-4623-9824-237579779DA0}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdvmp", "driver\sdvmp.vcxproj", "{02EF9EF3-C435-491C-A82D-B6C522C20EF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E6EA3861-2C59-4623-9824-237579779DA0}.Debug|Win32.ActiveCfg = Debug|Win32
- {E6EA3861-2C59-4623-9824-237579779DA0}.Debug|Win32.Build.0 = Debug|Win32
- {E6EA3861-2C59-4623-9824-237579779DA0}.Release|Win32.ActiveCfg = Release|Win32
- {E6EA3861-2C59-4623-9824-237579779DA0}.Release|Win32.Build.0 = Release|Win32
- {E6EA3861-2C59-4623-9824-237579779DA0}.Debug|x64.ActiveCfg = Debug|x64
- {E6EA3861-2C59-4623-9824-237579779DA0}.Debug|x64.Build.0 = Debug|x64
- {E6EA3861-2C59-4623-9824-237579779DA0}.Release|x64.ActiveCfg = Release|x64
- {E6EA3861-2C59-4623-9824-237579779DA0}.Release|x64.Build.0 = Release|x64
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Debug|Win32.Build.0 = Debug|Win32
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Release|Win32.ActiveCfg = Release|Win32
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Release|Win32.Build.0 = Release|Win32
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Debug|x64.ActiveCfg = Debug|x64
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Debug|x64.Build.0 = Debug|x64
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Release|x64.ActiveCfg = Release|x64
+ {02EF9EF3-C435-491C-A82D-B6C522C20EF2}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj b/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj
index efc2caa8..102b4763 100644
--- a/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj
+++ b/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj
@@ -19,12 +19,12 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{E6EA3861-2C59-4623-9824-237579779DA0}</ProjectGuid>
+ <ProjectGuid>{02EF9EF3-C435-491C-A82D-B6C522C20EF2}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{3FA5E028-F8C7-4610-BA5A-6B04A17DEDE5}</SampleGuid>
+ <SampleGuid>{EF417BA1-CCC0-492E-A5AA-ADBD35593C0C}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj.Filters b/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj.Filters
index ada8b238..790b6262 100644
--- a/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj.Filters
+++ b/tools/sdv/samples/SDV-FailDriver-NDIS/driver/sdvmp.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{1E135777-CFFB-4A1C-B464-B85D375B7315}</UniqueIdentifier>
+ <UniqueIdentifier>{92B9D09A-72F0-4689-A058-2A9359E8B9BF}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{EB501283-B000-4709-88B1-A9F7DCA45ECD}</UniqueIdentifier>
+ <UniqueIdentifier>{D8538355-EF1B-41B1-8D78-D84656C52603}</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>{9583582B-8D53-434E-9D38-89394374499D}</UniqueIdentifier>
+ <UniqueIdentifier>{A1301BEB-57D3-4DC8-B870-A978887F65A9}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{C8339997-9DEA-40D9-9FD2-FB8D037EB104}</UniqueIdentifier>
+ <UniqueIdentifier>{92BF6DEC-394B-4DB1-80FC-898AD9177036}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/tools/sdv/samples/SDV-FailDriver-STORPORT/SDV-FailDriver-STORPORT.sln b/tools/sdv/samples/SDV-FailDriver-STORPORT/SDV-FailDriver-STORPORT.sln
index 66e73619..471cd94e 100644
--- a/tools/sdv/samples/SDV-FailDriver-STORPORT/SDV-FailDriver-STORPORT.sln
+++ b/tools/sdv/samples/SDV-FailDriver-STORPORT/SDV-FailDriver-STORPORT.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lsi_u3", "driver\lsi_u3.vcxproj", "{61D9DA2C-F833-42D8-8389-09DE73184BF7}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lsi_u3", "driver\lsi_u3.vcxproj", "{67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Debug|Win32.ActiveCfg = Debug|Win32
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Debug|Win32.Build.0 = Debug|Win32
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Release|Win32.ActiveCfg = Release|Win32
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Release|Win32.Build.0 = Release|Win32
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Debug|x64.ActiveCfg = Debug|x64
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Debug|x64.Build.0 = Debug|x64
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Release|x64.ActiveCfg = Release|x64
- {61D9DA2C-F833-42D8-8389-09DE73184BF7}.Release|x64.Build.0 = Release|x64
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Debug|Win32.Build.0 = Debug|Win32
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Release|Win32.ActiveCfg = Release|Win32
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Release|Win32.Build.0 = Release|Win32
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Debug|x64.ActiveCfg = Debug|x64
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Debug|x64.Build.0 = Debug|x64
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Release|x64.ActiveCfg = Release|x64
+ {67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj b/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj
index e4880679..4a16ad3d 100644
--- a/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj
+++ b/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj
@@ -19,12 +19,12 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{61D9DA2C-F833-42D8-8389-09DE73184BF7}</ProjectGuid>
+ <ProjectGuid>{67CDF2E4-3B00-4AD2-9DEC-6B673C8C125C}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{C8BA9100-04CD-4D5E-BE47-7F4B5523B604}</SampleGuid>
+ <SampleGuid>{D25740CC-3A13-4D50-9AD5-6D09F65436D7}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj.Filters b/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj.Filters
index 6a1e0e23..e5753da7 100644
--- a/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj.Filters
+++ b/tools/sdv/samples/SDV-FailDriver-STORPORT/driver/lsi_u3.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{1F5F254C-AB38-4FEC-8986-38F49451F32B}</UniqueIdentifier>
+ <UniqueIdentifier>{7594D3A3-DD56-456E-AB60-727F05AF967A}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{FD66C234-8B1A-42F4-B9F1-8E9395C682B1}</UniqueIdentifier>
+ <UniqueIdentifier>{3C42A111-A210-4D54-9C14-69F71F5CD352}</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>{C5FB1C38-51A7-4F32-977E-62A377CE9638}</UniqueIdentifier>
+ <UniqueIdentifier>{A1364796-7682-4809-ABF0-1649A346DA87}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{42A467BB-9477-4CAD-9A6C-1819986F8E21}</UniqueIdentifier>
+ <UniqueIdentifier>{8CA1E2E9-8D4A-4225-89A7-A4F6869DF586}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln b/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln
index 67ea0c49..2738bb18 100644
--- a/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/SDV-FailDriver-WDM.sln
@@ -3,7 +3,7 @@ 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", "{653F3506-0E37-443B-ACF8-4DB2E50EAE27}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fail_driver1", "driver\fail_driver1.vcxproj", "{7F88D5C5-F05F-4817-89F5-C811053277A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Debug|Win32.ActiveCfg = Debug|Win32
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Debug|Win32.Build.0 = Debug|Win32
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Release|Win32.ActiveCfg = Release|Win32
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Release|Win32.Build.0 = Release|Win32
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Debug|x64.ActiveCfg = Debug|x64
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Debug|x64.Build.0 = Debug|x64
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Release|x64.ActiveCfg = Release|x64
- {653F3506-0E37-443B-ACF8-4DB2E50EAE27}.Release|x64.Build.0 = Release|x64
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|Win32.Build.0 = Debug|Win32
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.ActiveCfg = Release|Win32
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|Win32.Build.0 = Release|Win32
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.ActiveCfg = Debug|x64
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Debug|x64.Build.0 = Debug|x64
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.ActiveCfg = Release|x64
+ {7F88D5C5-F05F-4817-89F5-C811053277A0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj
index 3c347d35..f3a16b7c 100644
--- a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj
@@ -19,12 +19,12 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{653F3506-0E37-443B-ACF8-4DB2E50EAE27}</ProjectGuid>
+ <ProjectGuid>{7F88D5C5-F05F-4817-89F5-C811053277A0}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{59613085-21C3-4A10-923E-5216AB8A902F}</SampleGuid>
+ <SampleGuid>{5B7623CB-C6FA-4BD9-B152-49D2AF3AFFF9}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
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
index e0977ad5..a2daf153 100644
--- a/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters
+++ b/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{F688E2BB-177F-4A7D-81B1-029AA44F4726}</UniqueIdentifier>
+ <UniqueIdentifier>{32CBBE36-499A-4654-A158-B4819DAE347A}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{BD8BED2B-18A9-47E9-BD65-AAEEF4CBEBE2}</UniqueIdentifier>
+ <UniqueIdentifier>{DDA46AD7-AE99-4C7D-AE9B-DC953334086A}</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>{F06FCDF6-5892-465F-8164-24C88B27DFD3}</UniqueIdentifier>
+ <UniqueIdentifier>{0CB246C6-2757-42F9-A79F-C5EB01F57878}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{28A8F639-8487-4DD4-B532-CBBAA8B25661}</UniqueIdentifier>
+ <UniqueIdentifier>{5CF91836-38DE-43A4-9446-5C6F8C23E6D8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>