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.

Windows for business | Windows Client for IT Pros | Devices and deployment | Other
Developer technologies | C++
Developer technologies | Visual Studio | Other
{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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.