PREfast for Drivers

PREfast for Drivers (Prefast.exe) is a compile-time static verification tool that is designed to detect errors that are missed by the compiler and by conventional runtime testing. PREfast for Drivers includes PREfast, a component that detects common basic coding errors in C and C++ programs and a specialized driver module that is designed to detect errors in kernel-mode driver code. You can run PREfast for Drivers very early in the development cycle--as soon as the code compiles correctly.

PREfast for Drivers differs from other verification tools in the Windows Driver Kit (WDK) in that it examines each function in the code independently and then simulates the execution of all possible paths through the code, looking for common driver errors and unwise coding practices. PREfast for Drivers runs relatively quickly, even on larger drivers, and the report that it generates precisely identifies the line of driver code with the suspected error.

PREfast for Drivers runs on Windows XP and later versions of Windows. PREfast for Drivers is designed to analyze 32-bit code written for x86- and x64-based platforms. It can analyze C and C++ source files, including managed code.

PREfast for Drivers is included in the WDK in the \tools\PFD subdirectory of the Windows Driver Kit documentation and runs in a build environment window. Use PREfast for Drivers in conjunction with Driver Verifier, Static Driver Verifier, and the checked build of Windows to ensure that your driver code is safe and reliable.

This section includes:

PREfast for Drivers Overview

Running PREfast for Drivers

Interpreting the Defect Log

PREfast for Drivers Commands

PREfast for Drivers Examples

PREfast for Drivers Annotations

PREfast for Drivers Warnings

Note  The Microsoft Windows Driver Development Kit (DDK) includes the standard version of PREfast and PREfast for Drivers. The Windows Driver Kit (WDK) includes only PREfast for Drivers. When using the WDK, no special configuration is necessary to distinguish PREfast for Drivers from the standard version.

The C/C++ Code Analysis tool in Visual Studio Team System, Team Edition for Developers is a version of PREfast without the specialized driver module

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011