Share via


Applying a Preset Filter

You can apply a preset filter to the text-formatted contents of the Defect Log that is displayed at the command line or to the interactive XML-formatted Defect Log. When you apply a preset filter, only the warnings that are included in the filter appear in the Defect Log. All other warnings are hidden.

For a list of preset filters, see List of Preset Filters.

To apply a preset filter to an open Defect Log:

  1. In a build environment window, navigate to the directory in which you ran PREfast for Drivers.

  2. Use a PREfast View command to open a Defect Log.

  3. Click Filter.

  4. From the Presets drop-down list, select a filter.

    The following screen shot shows the items on the Presets list.

    Screen shot showing the items in the Presets list

  5. Click Apply.

    The following screen shot shows what happens when you apply a preset filter to a Defect Log. In this example, applying the drivers_recommended filter hides all instances of warnings that are not included in the drivers_recommended filter, including Warnings 6001, 6011, 6014, and 6031.

    Screen shot showing that when you clear the check box for Warning 6029, and then click Apply, all instances of Warning 6029 are hidden in the log

To apply a preset filter to warnings displayed at the command line:

  1. In a build environment window, navigate to the directory in which you ran PREfast for Drivers.

  2. At the command line, type a PREfast List command that includes the /FilterPreset parameter. For example:

    prefast /FilterPreset=PresetName list
    

To apply a preset filter while opening a Defect Log:

  1. In a build environment window, navigate to the directory in which you ran PREfast for Drivers.

  2. At the command line, add the /FilterPreset parameter to a PREfast View command. For example:

    prefast /FilterPreset=PresetName view
    

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011