Check environment failed when run "static driver verifier"(SDV)

When I run WHLK test for my driver on OS version Win11 22621, it needs the SDV report. So I click Driver menu → launch static driver verifies, then VS2022 shows a window for me, I use the default config and click “run”, the error message in altert is:

[FATAL ERROR] Unrecoverable error in NormalBuild stage.
C:\Users\SUN\Desktop\Honor_APO\AwinicSKTuneApo_Original>cd /d “C:\Users\SUN\Desktop\Honor_APO\AwinicSKTuneApo_Original” && msbuild “AwinicSKTuneApo_For_Honor.vcxproj” /t:sdv /p:inputs=“/check /devenv” /p:configuration=“Release” /p:platform=“x64” /p:SolutionDir=“C:\Users\SUN\Desktop\Honor_APO\AwinicSKTuneApo_Original”
sdv:
staticdv /check /devenv
SDV: C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV
SMV: C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\smv
SDVAP: C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\smv\analysisplugins\sdv
Build environment: msbuild
[INFO] Cleaning …
[INFO] Setting interceptor platform to x64
[INFO] Setting platform to x86_amd64
[INFO] Validating XML against schema: C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\smv\bin\Config.xsd
[INFO] Running local scheduler with 4 threads
C:\Program Files (x86)\Windows Kits\10\build\windowsdriver.Sdv.targets(136,9): error MSB3073: command“staticdv /check /devenv” exit, -1.

I run the command “staticdv.exe /check /devenv” in CMD window, it shows the error message:
SDV does not support this build environment.
WDKContentRoot environment variable must not be null or empty.
SDV exit code: 24

So I add the WDKContentRoot environment variable in my system, but it also fails.
My development environment is: visual studio 2022 + WDK 22621 + SDK 22621, how I resolve the issue

First see this thread: https://community.osr.com/discussion/comment/307207#Comment_307207

SDV is broken in the current VS2022/WDK releases. You can use VS2019 and its WDK, or, as that is a real pain in the ass, use a VS2019 based EWDK toolchain, for example EWDK version co_release_svc_prod3.22000.832. Just use it ti get the sdv files you need for the HLK.

Also, you can’t just set WDKContentRoot. You need to run a ‘developer shell’, either the powershell or cmd versions and then run stuff from the command line. But even then the VS2022/WDK toolchain fails with SDV.

1 Like

Thanks, I will try it

Hi, Mark:
Thanks very much, I download EWDK_co_release_svc_prod3_22000_220715-1440 which is based vs2019, and I generate the SDV report successfully !!!
Thanks again