共用方式為


Building the Samples with Standalone PFD

PREfast for Drivers (PFD) includes a set of C++ sample files with intentional errors. These files are in the \tools\pfd\samples subdirectory of the WDK. You can use these examples to become familiar with PREfast for Drivers.

To build the samples

  1. Open a WDK build environment window.

    To open a build environment window, use the follow menu path:

    Start | All Programs | Windows Driver Kits | WDK_Version | Build Environment | Operating System | Build Environment.

    Select the build environment for the Windows version on which the driver runs. PREfast for Drivers supports free and checked versions of all x86 and x64 build environments.

  2. Navigate to the samples directory. For example:

    cd C:\WinDDK\bin\6000\tools\pfd\samples
    
  3. Type a PREfast Build command. For example:

    prefast build -cZ
    

    When you build the examples, the compiler detects two errors in the sample files. PREfast for Drivers also detects these errors, in addition to many more.

  4. Open the Defect Log**.** To open the Defect Log, type prefast view.

The remainder of this section discusses the errors that PREfast for Drivers found in the sample files. To make it easier to find the errors in your copy of the Defect Log, click the title of the Warning column in the Message List to sort the warnings by their warning number.

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011