Share via


Displaying the Defect Log at the Command Line

You can display the Defect Log contents at the command line in text format. To do so, in a build environment window, navigate to the directory in which you ran a PREfast for Drivers analysis, and use a PREfast List command. For example:

prefast list

If you are using OACR, you can use the oacr list command to display the log files that are maintained by OACR.

PREfast for Drivers generates the following output when you display the contents of the Defect Log for the PREfast for Drivers sample code in the \tools\pfd\samples WDK subdirectory.

For each warning, PREfast for Drivers displays the following elements:

  • Source file and line number of the code that is the subject of the warning. The line number appears in parentheses.

  • Warning number and description.

  • FUNCTION: The function name and line number in which the code that is the subject of the warning appears. The line number where the function begins appears in parentheses.

  • PATH: Indicates the code path to the statement that contains the error. The code path is indicated by the line numbers of statements in the path. If the warning did not involve a code path, the PATH field is omitted.

>prefast list
-----------------------------------------------------------------------------
Microsoft (R) PREfast Version 9.0
Copyright (C) Microsoft Corporation. All rights reserved.
-----------------------------------------------------------------------------
Contents of defect log: C:\Users\username\AppData\Roaming\Microsoft\PFD\defects.xml
-----------------------------------------------------------------------------
c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (97): warning 6014: (PFD)Leaking memory 'buffer'.
        FUNCTION: DispatchPnp (84)
        PATH: 97 100

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (47): warning 28101: The Drivers module has inferred that the current function is a DRIVER_INITIALIZE function:  This is informational only. No problem has been detected.
        FUNCTION: DriverEntry (47)

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (118): warning 28110: Drivers must protect floating-point hardware state. See use of float 2.850000:  Use KeSaveFloatingPointState/KeRestoreFloatingPointState around floating-point operations. Display Drivers should use the corresponding Eng... routines.
        FUNCTION: DispatchPower (104)
        PATH: 109 109 109 111 118

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (66): warning 28152: The return from an AddDevice-like function unexpectedly did not clear DO_DEVICE_INITIALIZING.
        FUNCTION: DriverAddDevice (66)
        PATH: 77 80

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (56): warning 28155: The function being assigned or passed should be a DRIVER_DISPATCH function:  Add the declaration 'DRIVER_DISPATCH DispatchPnp;' before the current first declaration of DispatchPnp.
        FUNCTION: DriverEntry (47)

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (56): warning 28169: The dispatch function 'DispatchPnp' does not have any __drv_dispatchType annotations:  This can be corrected by adding appropriate __drv_dispatchType annotations to the function. Unnecessary casts can cause this warning.
        FUNCTION: DriverEntry (47)

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (57): warning 28169: The dispatch function 'DispatchPower' does not have any __drv_dispatchType annotations:  This can be corrected by adding appropriate __drv_dispatchType annotations to the function. Unnecessary casts can cause this warning.
        FUNCTION: DriverEntry (47)

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (84): warning 28170: The function 'DispatchPnp' has been declared to be in a paged segment, but neither PAGED_CODE nor PAGED_CODE_LOCKED was found.
        FUNCTION: DispatchPnp (84)

c:\winddk\7011\tools\pfd\samples\fail_drivers\fail_driver1
\driver.c (126): warning 28172: The function 'DispatchSystemControl' has PAGED_CODE or PAGED_CODE_LOCKED but is not declared to be in a paged segment.
        FUNCTION: DispatchSystemControl (126)

c:\winddk\7011.0.winmain.081212-1248\tools\pfd\samples\fail_drivers\fail_driver1\driver.c (97): warning 28193: 'buffer' holds a value that must be examined.
        FUNCTION: DispatchPnp (84)
        PATH: 97 100

-----------------------------------------------------------------------------
10 of 10 Defects Listed
Filter in effect: Recommended Filters
-----------------------------------------------------------------------------
You can change the filter and sort options from the user interface.
Enter PREFAST VIEW to display the defect log user interface.

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011