Driver Verifier is a run-time verification tool that increases the effectiveness of your driver testing. You can enable and configure Driver Verifier to run on all test computers when you deploy your driver for testing.
You should always set up a kernel mode debugging connection with the test computer when you enable Driver Verifier on the remote test computer. For information about configuring a target computer and setting up a debug cable, see [Setting Up Kernel-Mode Debugging in Visual Studio](https://msdn.microsoft.com/en-us/windows/hardware/hh439376.
Setting Driver Verifier properties for driver package projects
- Open the property pages for your driver package. Right-click the driver package project in Solution Explorer and select Properties.
- In the property pages for the driver package, click Configuration Properties, click Driver Install, and then click Driver Verification.
- Select the Enable Driver Verification option. When this option is selected, you can select the driver or drivers to verify on the test computer and you can select the Driver Verifier options to use.
Project Configuration and Platform
The configuration list and platform list let you apply different deployment settings for different project configuration and platform combinations. For example, you can deploy a driver to one test computer using a set of deployment options for debug builds and to a different test computer using deployment options for release builds.
Enable Driver Verifier
You can enable Driver Verifier on the test computer for all drivers on the computer, for the driver project only, or for a list of specified drivers. For example, you might want to enable Driver Verifier for the set of drivers on the stack for a particular device.
Specifies which driver or drivers to verify on the test computer.
Specifies that Driver Verifier verifies all installed drivers on the remote test computer.
Specifies that Driver Verifier verifies the driver project installed on the remote test computer. This is the default option.
Specifies the driver or list of drivers that Driver Verifier verifies on the remote test computer. For example, you could list all of the drivers associated with a particular device. Specify the drivers by binary name, for example, Driver.sys. Use a semicolon to separate a list of drivers. Wildcard values, such as n\.sys*, are not supported.
Driver Verifier Standard Flags
You can configure the following Driver Verifier options on the test computer.
DDI compliance checking (Windows 8)
When this option is active, Driver Verifier applies a set of device driver interface (DDI) rules that check for the proper interaction between a driver and the kernel interface of the operating system.
When this option is active, Driver Verifier monitors the driver's use of spin locks, mutexes, and fast mutexes. This detects whether the driver's code has the potential for causing a deadlock at some point.
When this option is active, Driver Verifier monitors the driver's use of direct memory access (DMA) routines. This detects improper use of DMA buffers, adapters, and map registers.
When this option is active, Driver Verifier places extreme memory pressure on the driver by invalidating pageable code. If the driver attempts to access paged memory at the wrong IRQL or while holding a spin lock, Driver Verifier detects this behavior.
When this option is active, Driver Verifier allocates the driver's Interrupt Request Packets (IRPs) from a special pool, and monitors the driver's I/O handling. This detects illegal or inconsistent use of I/O routines. Driver Verifier also monitors the calls of several I/O Manager routines and performs stress testing of Plug-and-Play (PnP) IRPs, power IRPs and WMI IRPs.
When this option is active, Driver Verifier looks for common causes of driver crashes, such as the mishandling of freed memory.
When this option is active, Driver Verifier checks to see whether the driver has freed all of its memory allocations when it is unloaded. This reveals memory leaks.
When this option is active, Driver Verifier looks for common errors that can result in security vulnerabilities, such as a reference to user-mode addresses by kernel-mode routines.
When this option is active, Driver Verifier allocates most of the driver's memory requests from a special pool. This special pool is monitored for memory overruns, memory underruns, and memory that is accessed after it is freed.
Driver Verifier Scenario Specific Settings
When this option is active, Driver Verifier randomly fails pool allocation requests and other resource requests. By injecting these allocation faults into the system, Driver Verifier tests the driver's ability to cope with a low-resource situation.
When this option is active, Driver Verifier tests the driver's response to STATUS_PENDING return values by returning STATUS_PENDING for random calls to IoCallDriver.
When this option is active, Driver Verifier monitors a driver's use of IRPs and creates a log of IRP use.
Invariant MDL Checking for Stack (Windows 8)
The Invariant MDL Checking for Stack option monitors how the driver handles invariant MDL buffers across the driver stack. Driver Verifier can detect illegal modification of invariant MDL buffers. To use this option, I/O Verification must be enabled on at least one driver.
Invariant MDL Checking for Driver (Windows 8)
The Invariant MDL Checking for Driver option monitors how the driver handles invariant MDL buffers on a per-driver basis. This option detects illegal modification of invariant MDL buffers. To use this option, you must enable I/O Verification on at least one driver.
Power Framework Delay Fuzzing (Windows 8)
When this option is active, Driver Verifier randomizes thread schedules to help flush out concurrency errors in the driver.
Stack Based Failure Injection (Windows 8)
The Stack Based Failure Injection option injects resource failures in kernel-mode drivers. This option uses a special driver, KmAutoFail.sys, in conjunction with Driver Verifier to penetrate driver error handling paths.
Driver Verifier options that require I/O Verification
There are four options that require you to first enable I/O Verification. If I/O Verification is not enabled, these options are not enabled.
- Force Pending I/O Requests
- IRP Logging
- Invariant MDL Checking for Stack
- Invariant MDL Checking for Driver