SDV failing on a KMDF and WDM library

Hi

I am getting below errors when I invoked SDV. Stack has a KMDF SYS and WDM LIB

I just added below params to our MSBUILD cmd line
/t:sdv /p:“Inputs=/check:*”

All below fail as well except clean*
/t:sdv /property:“Inputs=/cleanalllibs”
/t:sdv /property:“Inputs=/clean”
/t:sdv /property:"Inputs=/lib
/t:sdv /property:“Inputs=/scan”
/t:sdv /property:“Inputs=/view”

All say below. Anything else I should do to enable this properly
“Unsupported driver type”


For KMDF sys I get below

WindowsKernelModeDriver8.0
Driver
KMDF

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
SDV does not support the driver due to driver type.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code 15. [C:<br>Backup\dir\sys\sources.VcxProj]
Done Building Project “C:\Backup\dir\sys\sources.VcxPro
j” (clean;build;sdv target(s)) – FAILED.

Build FAILED.
For WDM LIB

WindowsKernelModeDriver8.0
StaticLibrary
WDM

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
No previous SDV data found.
Build ‘fcs’ …Done
This driver did not build correctly.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code -1. [C:<br>Backup\dir\lib\sources.VcxProj]
Done Building Project “C:\Backup\dir\lib\sources.VcxProj” (
clean;build;sdv target(s)) – FAILED.

Build FAILED.

Is this from the //build/ build?

d

debt from my phone


From: xxxxx@yahoo.com
Sent: 11/15/2011 4:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SDV failing on a KMDF and WDM library

Hi

I am getting below errors when I invoked SDV. Stack has a KMDF SYS and WDM LIB

I just added below params to our MSBUILD cmd line
/t:sdv /p:“Inputs=/check:*”

All below fail as well except clean*
/t:sdv /property:“Inputs=/cleanalllibs”
/t:sdv /property:“Inputs=/clean”
/t:sdv /property:"Inputs=/lib
/t:sdv /property:“Inputs=/scan”
/t:sdv /property:“Inputs=/view”

All say below. Anything else I should do to enable this properly
“Unsupported driver type”


For KMDF sys I get below

WindowsKernelModeDriver8.0
Driver
KMDF

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
SDV does not support the driver due to driver type.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code 15. [C:<br>Backup\dir\sys\sources.VcxProj]
Done Building Project “C:\Backup\dir\sys\sources.VcxPro
j” (clean;build;sdv target(s)) – FAILED.

Build FAILED.
For WDM LIB

WindowsKernelModeDriver8.0
StaticLibrary
WDM

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
No previous SDV data found.
Build ‘fcs’ …Done
This driver did not build correctly.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code -1. [C:<br>Backup\dir\lib\sources.VcxProj]
Done Building Project “C:\Backup\dir\lib\sources.VcxProj” (
clean;build;sdv target(s)) – FAILED.

Build FAILED.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Yes. Thanks.

Hi There,

Does this driver build fine without sdv check added into the msbuild?
Sdv doesn’t support 1.5 and below KMDF drivers. I assume your driver is built with KMDF 1.11, if that’s the case then can you please tell your driver’s type and the libraries you’re depended on for your driver to build?
Also have you tried using the SDV console which you can start from the Driver tab in VS project? Does it work?

Thank you,
Neslihan

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Tuesday, November 15, 2011 4:35 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SDV failing on a KMDF and WDM library

Is this from the //build/ build?

d

debt from my phone


From: xxxxx@yahoo.commailto:xxxxx
Sent: 11/15/2011 4:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SDV failing on a KMDF and WDM library
Hi

I am getting below errors when I invoked SDV. Stack has a KMDF SYS and WDM LIB

I just added below params to our MSBUILD cmd line
/t:sdv /p:“Inputs=/check:"

All below fail as well except clean

/t:sdv /property:“Inputs=/cleanalllibs”
/t:sdv /property:“Inputs=/clean”
/t:sdv /property:“Inputs=/lib
/t:sdv /property:“Inputs=/scan”
/t:sdv /property:“Inputs=/view”

All say below. Anything else I should do to enable this properly
“Unsupported driver type”


For KMDF sys I get below

WindowsKernelModeDriver8.0
Driver
KMDF

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
SDV does not support the driver due to driver type.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
” exited with code 15. [C:<br>Backup\dir\sys\sources.VcxProj]
Done Building Project “C:\Backup\dir\sys\sources.VcxPro
j” (clean;build;sdv target(s)) – FAILED.

Build FAILED.
For WDM LIB

WindowsKernelModeDriver8.0
StaticLibrary
WDM

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
No previous SDV data found.
Build ‘fcs’ …Done
This driver did not build correctly.
C:\Program Files (x86)\Windows Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
” exited with code -1. [C:<br>Backup\dir\lib\sources.VcxProj]
Done Building Project “C:\Backup\dir\lib\sources.VcxProj” (
clean;build;sdv target(s)) – FAILED.

Build FAILED.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx>

I don’t know if this has been asked yet, but have you considered using
PREFast instead?

It works quite well.

mm

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neslihan Bulut
Sent: Wednesday, November 16, 2011 1:11 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SDV failing on a KMDF and WDM library

Hi There,

Does this driver build fine without sdv check added into the msbuild?

Sdv doesn’t support 1.5 and below KMDF drivers. I assume your driver is
built with KMDF 1.11, if that’s the case then can you please tell your
driver’s type and the libraries you’re depended on for your driver to build?

Also have you tried using the SDV console which you can start from the
Driver tab in VS project? Does it work?

Thank you,

Neslihan

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Tuesday, November 15, 2011 4:35 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SDV failing on a KMDF and WDM library

Is this from the //build/ build?

d

debt from my phone


From: xxxxx@yahoo.com
Sent: 11/15/2011 4:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] SDV failing on a KMDF and WDM library

Hi

I am getting below errors when I invoked SDV. Stack has a KMDF SYS and WDM
LIB

I just added below params to our MSBUILD cmd line
/t:sdv /p:“Inputs=/check:*”

All below fail as well except clean*
/t:sdv /property:“Inputs=/cleanalllibs”
/t:sdv /property:“Inputs=/clean”
/t:sdv /property:"Inputs=/lib
/t:sdv /property:“Inputs=/scan”
/t:sdv /property:“Inputs=/view”

All say below. Anything else I should do to enable this properly
“Unsupported driver type”


For KMDF sys I get below

WindowsKernelModeDriver8.0
Driver
KMDF

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
SDV does not support the driver due to driver type.
C:\Program Files (x86)\Windows
Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code 15.
[C:<br>Backup\dir\sys\sources.VcxProj]
Done Building Project “C:\Backup\dir\sys\sources.VcxPro
j” (clean;build;sdv target(s)) – FAILED.

Build FAILED.
For WDM LIB

WindowsKernelModeDriver8.0
StaticLibrary
WDM

Sdv:
staticdv.exe /check:
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for
No previous SDV data found.
Build ‘fcs’ …Done
This driver did not build correctly.
C:\Program Files (x86)\Windows
Kits\8.0\build\WindowsDriver8.0.Sdv.targets(54,9
): error MSB3073: The command "staticdv.exe /check:
" exited with code -1.
[C:<br>Backup\dir\lib\sources.VcxProj]
Done Building Project “C:\Backup\dir\lib\sources.VcxProj” (
clean;build;sdv target(s)) – FAILED.

Build FAILED.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi

>Does this driver build fine without sdv check added into the msbuild?
Yes

>Sdv doesn’t support 1.5 and below KMDF drivers. I assume your driver is built
with KMDF 1.11,
My KMDF is 1.9

<kmdf_version_major>1</kmdf_version_major>
<kmdf_version_minor>9<kmdf_version_minor>

>>Libraries
Just uses the default ones. This driver was based of toaster KMDF sample


%(AdditionalDependencies);$(WIN8_WDK_LIB_PATH)\ndis.lib


>>Also have you tried using the SDV console which you can start from the Driver
tab in VS project? Does it work?

I am not able to start SDV console for VS11. I think becuase I have not yet integrated my vcxprojs in to VS11, I mean I am using my batch script to invoke msbuild.exe etc.
When I quickly did integarte my VcxProjs in to VS11 and invoked SDV from VS11 IDE it said unrecognided driver types ‘kmdf_ndis’, ‘kmdf"stoport’ for my sys files.

But when I go to Staticdv.exe dir and run staticdv. I get below.

Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
The %SDV% environment variable is not set on the system. Reinstall SDV to set th
is variable.
The %SDV% environment variable is not set on the system. Reinstall SDV to set th
is variable.
Build type could not be set.
Build Architecture could not be set.
SDV could not find the WDM include folder.
Exception invalid process
SDV could not find the DDK include folder.
The %SDV% environment variable is not set on the system. Reinstall SDV to set th
is variable.</kmdf_version_minor></kmdf_version_minor>

Hi

I use prefast as well, I thought SDV is much more semantic and useful., so trying it out.

Thx

Fair enough.

For what it is worth, I think it would be a pretty common view here (ntdev)
that SDV doesn’t work particularly well. No harm in trying it out, of
course, and I have no idea of what the WIN8 version is like, but if it
starts consuming a lot of time to get it working, you might want to do
something like compare a prefast run v. a sdv run for a wdk sample and
evaluate the differences.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, November 16, 2011 1:57 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] SDV failing on a KMDF and WDM library

Hi

I use prefast as well, I thought SDV is much more semantic and useful., so
trying it out.

Thx


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I don’t think that this is the issues, but if I recall correctly, ‘sdv’ is a
batch file that wraps staticdv.exe, and they sometimes behave very
differently.

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, November 16, 2011 1:54 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] SDV failing on a KMDF and WDM library

Hi

>Does this driver build fine without sdv check added into the msbuild?
Yes

>Sdv doesn’t support 1.5 and below KMDF drivers. I assume your driver
>is built
with KMDF 1.11,
My KMDF is 1.9

<kmdf_version_major>1</kmdf_version_major>
<kmdf_version_minor>9<kmdf_version_minor>

>>Libraries
Just uses the default ones. This driver was based of toaster KMDF sample



%(AdditionalDependencies);$(WIN8_WDK_LIB_PATH)\ndis.
lib


>>Also have you tried using the SDV console which you can start from the
>>Driver
tab in VS project? Does it work?

I am not able to start SDV console for VS11. I think becuase I have not yet
integrated my vcxprojs in to VS11, I mean I am using my batch script to
invoke msbuild.exe etc.
When I quickly did integarte my VcxProjs in to VS11 and invoked SDV from
VS11 IDE it said unrecognided driver types ‘kmdf_ndis’, ‘kmdf"stoport’ for
my sys files.

But when I go to Staticdv.exe dir and run staticdv. I get below.

Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0 Copyright
(C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
The %SDV% environment variable is not set on the system. Reinstall SDV to
set th is variable.
The %SDV% environment variable is not set on the system. Reinstall SDV to
set th is variable.
Build type could not be set.
Build Architecture could not be set.
SDV could not find the WDM include folder.
Exception invalid process
SDV could not find the DDK include folder.
The %SDV% environment variable is not set on the system. Reinstall SDV to
set th is variable.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</kmdf_version_minor></kmdf_version_minor>

Thanks. Will compare SDV vs. PREfast results and see if there is any significant delta to convince for SDV

SDV WDF rules doesn’t run against hybrid drivers; that use both Wdf and ndis libraries. Here this driver is an ndis driver, I assume that the driver is intentionally linked with ndis.lib.

To clarify the prefast and sdv comparison, these two static verification tools check for different types of problems. You’re right on that SDV is verifying the driver code semantically and it tests the driver simulating different scenarios. The best option for verifying the driver quality would be to run both of these tools on it.

Thank you,
Neslihan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, November 16, 2011 1:54 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] SDV failing on a KMDF and WDM library

Hi

>Does this driver build fine without sdv check added into the msbuild?
Yes

>Sdv doesn’t support 1.5 and below KMDF drivers. I assume your driver
>is built
with KMDF 1.11,
My KMDF is 1.9

<kmdf_version_major>1</kmdf_version_major>
<kmdf_version_minor>9<kmdf_version_minor>

>>Libraries
Just uses the default ones. This driver was based of toaster KMDF sample


%(AdditionalDependencies);$(WIN8_WDK_LIB_PATH)\ndis.lib


>>Also have you tried using the SDV console which you can start from the
>>Driver
tab in VS project? Does it work?

I am not able to start SDV console for VS11. I think becuase I have not yet integrated my vcxprojs in to VS11, I mean I am using my batch script to invoke msbuild.exe etc.
When I quickly did integarte my VcxProjs in to VS11 and invoked SDV from VS11 IDE it said unrecognided driver types ‘kmdf_ndis’, ‘kmdf"stoport’ for my sys files.

But when I go to Staticdv.exe dir and run staticdv. I get below.

Microsoft (R) Windows (R) Static Driver Verifier Version 2.1.454.0 Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
The %SDV% environment variable is not set on the system. Reinstall SDV to set th is variable.
The %SDV% environment variable is not set on the system. Reinstall SDV to set th is variable.
Build type could not be set.
Build Architecture could not be set.
SDV could not find the WDM include folder.
Exception invalid process
SDV could not find the DDK include folder.
The %SDV% environment variable is not set on the system. Reinstall SDV to set th is variable.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</kmdf_version_minor></kmdf_version_minor>

Thanks.
Yes link to ndis.lib is intentinal.

My stack consists of below

KMDF Virtual Bus driver (toaster sample) but also hosts a NDIS Protocol driver - kmdf_ndis.
(one .sys but 2 infs etc)
2)
WDM Libarary
3)
Virtual Storport miniport that static links to 2).
For some reason during nmake2VcxProj conversion, 3) got tagged as KMDF dirver (kmdf_storport).
I do not not see why it has to be a KMDF driver. I will make pure WDM Vstorport driver and see if I have any luck.


http://msdn.microsoft.com/en-us/library/windows/hardware/ff544647(v=vs.85).aspx

Just to move forward and get some SDV coverage as well here, I can break [1] in to two .sys’es to have SDV run on then (kmdf, ndis).
[1?] But does SDV covers NDIS protoocl drivers?
In above links I do not see Role Types for NDIS ***protocol*** drivers, only lists ***miniport*** exports?

Thanks.

SDV does support protocol based NDIS drivers for NDIS 6.0 and above.

See the following MSDN link for more details http://msdn.microsoft.com/en-us/library/windows/hardware/ff552825(v=VS.85).aspx on how to add roletypes to NDIS drivers. This is required to run SDV.

Thanks Conal.