Static Driver Verifier Commands
Type the following SDV commands in a WDK build environment window in the directories where the driver's sources file or the library's sources file are stored. The parameters can appear in any order on the command line.
staticdv [/rule:{Rule | *} ] [ /refine /rule:{Rule | * } ]
[/config:RuleList.sdv ] [ /refine /config:RuleList.sdv ]
[/lib ]
[/view ]
[/scan ]
[/clean [/force] ]
[/cleanalllibs]
[/? ] [/help ] [/showrules ]
Parameters
/scan
Scans the driver's source code for function role type declarations. For information about how to declare the driver supplied callback functions and dispatch routines, see Using Function Role Type Declarations. During this scan, SDV tries to detect the driver entry points that it needs to verify the driver. It records the results of the scan in Sdv-map.h, a file that it creates in the driver's sources directory.For more information, see Preparing to Run Static Driver Verifier.
/rule:{Rule | *}
Starts a verification with the specified rule(s). Run staticdv /rule commands in the directory that stores the sources file for the driver (known as the driver's sources directory).Rule is the name of one rule or a rule name pattern that includes wildcard characters (*) to represent one or more characters. When used alone, the wildcard character (*) represents all rules. You cannot specify more than one rule name or rule name pattern.
/config:RuleList.sdv
Starts a verification with the rules in the specified rule list file. You can list only one file with this parameter. In the rule list file, each line can be the name of one rule or it can be a wildcard character (*), which represents all SDV rules. You can also use the wildcard character (*) in a rule name to mean any character or characters. Run staticdv /config commands in the driver's sources directory.RuleList**.sdv** is the fully qualified path and file name of a rule list file. The file must have the .sdv file name extension. Unless the file is in the local directory, the path is required. If the path or file name includes spaces, you must enclose *RuleList.*sdv in quotation marks.
/refine
Does a per entry verification for the rule or rules specified with the /rule: or /config: options. The /refine option partitions the verification process into groups of related entry points. This allows SDV to produce useful results for larger drivers./lib
Processes the library. SDV calls build.exe to compile and build the library for external use, and it generates the files that it needs to include the library in the driver verification.Use this parameter before verifying drivers that require the library. Run staticdv /lib commands in the directory that stores the sources file for the library (known as the library's sources directory).
For more information about the use and effect of the /lib parameter, see Library Processing in Static Driver Verifier.
/view
Opens the Static Driver Verifier Report. Run staticdv /view commands in the driver's sources directory.The Static Driver Verifier Report is available as soon as a verification is complete, and it remains available until you use a staticdv /clean command to delete the SDV files from the driver's sources directory.
/clean
Deletes SDV files from the directory. Because these files are used to generate the Static Driver Verifier Report display, the /clean command also deletes the report of the verification.Run a staticdv /clean command in the driver's sources directory or in the library's sources directory. The command deletes SDV files only in the directory in which it is run.
When run in a driver's sources directory, commands using this parameter delete the files that SDV creates when it builds and verifies the driver. Run a staticdv /clean this command in the driver's sources directory before each verification.
When run in a library's sources directory, commands using this parameter delete the files that SDV creates when it processes the library (/lib). Run a staticdv /clean command in the library's sources directory only when the library files are outdated, such as when the library code changes.
A staticdv /clean command does not remove the Sdv-map.h file, if the approved flag is set to true in the Sdv-map.h file (Approved=true). SDV can then use this file for future verifications.
/force Forces SDV to perform a staticdv /clean command. Use this parameter when SDV has completed a verification and a staticdv /clean command fails. Typically, a staticdv /clean /force command is required when a library processing command (staticdv /lib) or driver verification (staticdv /rule or staticdv /config) is interrupted.
/cleanalllibs
Deletes the library-processing files that SDV created in all directories on the computer's hard disk drives. It does not affect driver data.You can run a staticdv /cleanalllibs command in any directory of the build environment window.
Use this parameter to remove all library processing files that SDV created or when the code in several libraries has changed. For more information about library processing files, see Deleting Static Driver Verifier Library Files.
/?
Displays usage for SDV commands. Commands that use this parameter do not have to be run in a build environment window./help
Displays the SDV documentation. Commands that use this parameter do not have to be run in a build environment/showrules
Displays the SDV Rules section of the documentation. Commands that use this parameter do not have to be run in a build environment window.
Comments
Running staticdv without parameters displays usage for the SDV commands.
A staticdv /clean command deletes the files that SDV uses to create the Static Driver Verifier Report display for a verification. After running this command, the Static Driver Verifier Report display for the verification is no longer available.
Examples
To run SDV using all rules on the driver files in the local directory:
staticdv /rule:*To combine the SDV /clean command with the SDV command to run all rules on the driver:
staticdv /clean && staticdv /rule:*To run SDV using all rules that begin with "Irql" on the driver files in the local directory:
staticdv /rule:Irql*To run SDV using the CancelSpinLock rule on the driver files in the local directory:
staticdv /rule:CancelSpinLockTo run SDV using the rule that is specified in the Rules1.sdv rule list file in the D:\SDV directory:
staticdv /config:D:\SDV\Rules1.sdvTo run SDV again, this time using the /refine option on the rules in the Rules1.sdv rule list file:
staticdv /refine /config:D:\SDV\Rules1.sdvTo display the Static Driver Verifier Report report for the most recent verification of the driver in the local directory:
staticdv /viewTo display the Static Driver Verifier Rules reference section of the documentation:
staticdv /showrules
Send comments about this topic to Microsoft
Build date: 5/3/2011