Running Static Driver Verifier on KMDF USB template project

Andreas Brykt 1 Reputation point
2022-05-05T11:29:59.92+00:00

I am trying Static Driver Verifier and wanted to start with running this on one of the template projects in Visual Studio 2019. I have followed the steps to install VS 2019, SDK for Windows 11 and WDK. https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk

I have selected Release configuration for x64 platform, and custom rule set picking only the "DriverCreate" rule. If I comment out the call to "WdfDriverCreate" and set the "status" variable to "STATUS_SUCCESS" then I get a "MustFix Defect" result. If I leave the code as it is from the template then I get "error" as result.

sdv/results/drivercreate_SDV.xml looks like this:

<?xml version="1.0"?>
<RuleResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<defect>false</defect>
<Name>drivercreate</Name>
<Result>SDV_TOOLERROR</Result>
<IsPreCondition>false</IsPreCondition>
<IsMustFix>true</IsMustFix>
<isWarning>false</isWarning>
</RuleResult>

How can I fix this SDV_TOOLERROR result. I have tried this on two computers with the same result.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,869 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,628 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,575 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Brykt 1 Reputation point
    2022-05-24T12:56:43.617+00:00

    I've attached the output from running msbuild /t:sdv /p:Inputs="/check:* /debug" TestSdv.vcxproj /p:Configuration="Release" /p:Platform=x64 in 205105-output.txt

    sdv/drivercreate_SDV.xml still says that the result is SDV_TOOLERROR.

       <?xml version="1.0"?>  
       <RuleResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
         <defect>false</defect>  
         <Name>drivercreate</Name>  
         <Result>SDV_TOOLERROR</Result>  
         <IsPreCondition>false</IsPreCondition>  
         <IsMustFix>true</IsMustFix>  
         <isWarning>false</isWarning>  
       </RuleResult>  
     
    

    I've searched the log in output.txt but I cannot find anything that points to the problem.

    Can you find anything that can give us a clue?

    Thanks!

    /Regards

    Andreas