Driver Verifier

Driver Verifier monitors Windows kernel-mode drivers and graphics drivers to detect illegal function calls or actions that might corrupt the system. Driver Verifier can subject Windows drivers to a variety of stresses and tests to find improper behavior. You can configure which tests to run, which allows you to put a driver through heavy stress loads or through more streamlined testing. You can also run Driver Verifier on multiple drivers simultaneously, or on one driver at a time.

Caution

  • Running Driver Verifier could cause the computer to crash.
  • You should only run Driver Verifier on computers that you are using for testing and debugging.
  • You must be in the Administrators group on the computer to use Driver Verifier.

Where can I download Driver Verifier?

You don't need to download Driver Verifier, because it is included with most versions of Windows in %WinDir%\system32\ as Verifier.exe. (Driver Verifier is not included with Windows 10 S, so we recommend testing driver behavior on Windows 10 instead.) Driver Verifier is not distributed separately as a download package.

For information about changes in Driver Verifier for Windows 10 and previous versions of Windows, see Driver Verifier: What's New.

When to use Driver Verifier

Run Driver Verifier throughout development and testing of your driver. More specifically, use Driver Verifier for the following purposes:

  • To find problems early in the development cycle, when they are easier and less costly to correct.

  • For troubleshooting and debugging test failures and computer crashes.

  • To monitor behavior when you deploy a driver for testing using the WDK, Visual Studio, and the tests from the Windows Hardware Lab Kit (Windows HLK) or Windows Hardware Certification Kit (for Windows 8.1). For more information about testing drivers, see Testing a Driver.

Important

Windows Hardware Compatibility Program requires CodeQL for Static Tool Logo (STL) Tests on our Client and Server Operating Systems. We will continue to maintain support for SDV and CA on older products. Partners are highly encouraged to review the CodeQL requirements for the Static Tool Logo Test. For more information about using CodeQL, see CodeQL and the Static Tools Logo Test.

How to start Driver Verifier

You should only run Driver Verifier on test computers, or on computers that you are testing and debugging. To get the most benefit from Driver Verifier, you should use a kernel debugger and connect to the test computer. For more information about debugging tools, see Debugging Tools for Windows (WinDbg, KD, CDB, NTSD).

  1. Start a Command Prompt window by selecting Run as administrator, and type verifier to open Driver Verifier Manager.

  2. Select Create standard settings (the default task), and select Next.

    You can also choose Create custom settings to select from predefined settings, or to select individual options. For more information, see Driver Verifier options and rule classes and Selecting Driver Verifier Options.

  3. Under Select what drivers to verify, choose one of the selection schemes described in the following table.

    Option Recommended use
    Automatically select unsigned drivers

    Useful for testing on computers that are running versions of Windows that do not require signed drivers.

    Automatically select drivers built for older versions of Windows

    Useful for testing driver compatibility with newer versions of Windows.

    Automatically select all drivers installed on this computer

    Provides maximum coverage in terms of the number of drivers that are tested on a system. This option is useful for test scenarios where a driver can interact with other devices or drivers on a system.

    This option can also exhaust the resources available for Special Pool and some resource tracking. Testing all drivers can also adversely affect system performance.

    Select driver names from a list

    In most cases, you will want to specify which drivers to test.

    Selecting all drivers in a device stack allows the Enhanced I/O Verification option to track objects and check compliance because an I/O request packet (IRP) is passed between each of the drivers in the stack, which allows for a greater level of detail to be provided when an error is detected.

    Select a single driver if you are running a test scenario that measures system or driver performance metrics, or if you want to allocate the greatest number of resources available for detecting memory corruption or resource tracking issues (such as deadlocks or mutexes). The Special Pool and I/O Verification options are more effective when used on one driver at a time.

  4. If you chose Select driver names from a list, select Next, and then select one or more specific drivers.

  5. Select Finish, and then restart the computer.

Note

When using driver verifier with Windows versions 20150 to 25126, if you have selected ntoskrnl you may receive an invalid state error.
To avoid this issue either unselect ntoskrnl or upgrade to a version of Windows after build 25126.

Run driver verifier at a command prompt

You can also run Driver Verifier in a Command Prompt window without starting Driver Verifier Manager. For example, to run Driver Verifier with the standard settings on a driver called myDriver.sys, you would use the following command:

verifier /standard /driver myDriver.sys

For more information about command line options, see Driver Verifier Command Syntax.

How to control Driver Verifier

You can use either Driver Verifier Manager or a command line to control Driver Verifier. To start Driver Verifier Manager, see How to start Driver Verifier, earlier in this topic.

For each of the following actions, you can use Driver Verifier Manager or enter a command line.

To stop or reset Driver Verifier

  1. In Driver Verifier Manager, select Delete existing settings, and then select Finish.

    or

    Enter the following command at a command prompt:

    verifier /reset
    
  2. Restart the computer.

To view Driver Verifier statistics

In Driver Verifier Manager, select Display information about the currently verified drivers, and then select Next. Continuing to select Next displays additional information.

or

Enter the following command at a command prompt:

verifier /query

To view Driver Verifier settings

In Driver Verifier Manager, select Display existing settings, and then select Next.

or

Enter the following command at a command prompt:

verifier /querysettings

How to debug Driver Verifier violations

To get the most benefit from Driver Verifier, you should use a kernel debugger and connect it to the test computer. For an overview of debugging tools for Windows, see Debugging Tools for Windows (WinDbg, KD, CDB, NTSD).

If Driver Verifier detects a violation, it generates a bug check to stop the computer. This is to provide you with the most information possible for debugging the issue. When you have a kernel debugger connected to a test computer that is running Driver Verifier, and Driver Verifier detects a violation, Windows breaks into the debugger and displays a brief description of the error.

All violations detected by Driver Verifier result in bug checks. This is typically a Bug Check 0xC4. For more information, see Debugging Bug Check 0xC4: DRIVER_VERIFIER_DETECTED_VIOLATION and Bug Check 0xC4: DRIVER_VERIFIER_DETECTED_VIOLATION.

Other common bug check codes include the following:

For more information, see Handling a Bug Check When Driver Verifier is Enabled.

When you start a new debugging session, use the debugger extension command, !analyze. In kernel mode, the !analyze command displays information about the most recent bug check. To display additional information, to help identify the faulting driver, add option -v to the command at the kd> prompt:

kd> !analyze -v

In addition to !analyze, you can enter the following debugger extensions at the kd> prompt to view information that is specific to Driver Verifier:

  • !verifier dumps captured Driver Verifier statistics. Use !verifier -? to display all of the available options.

    kd> !verifier
    
  • !deadlock displays information related to locks or objects tracked by Driver Verifier's deadlock detection feature. Use !deadlock -? to display all of the available options.

    kd> !deadlock
    
  • !iovirp [address] displays information related to an IRP tracked by I/O Verifier. For example:

    kd> !iovirp 947cef68
    
  • Look up the DDI compliance checking rule that was violated. (RuleID is always the first argument to the bug check.) All rule IDs from DDI compliance checking are in the form 0x200nn.

Driver Verifier Options

Driver Verifier Command Syntax

Using Driver Verifier

Controlling Driver Verifier

DDI compliance checking