none
Can Visual Studio 2010 be used for compiling and building drivers RRS feed

  • Question

  • Hello, 

    Visual Studio 2010 Ultimate does not have template for drivers. 

    I have read that windows 8 DDK is integrated into visual studio 2012. 

    Can visual studio 2010 can be used to compile and build drivers??



    Wednesday, January 30, 2013 9:31 AM

Answers

  • You have the win8 sample, you can't build it with the win7 kit. Under the the win7 kit root, under src, you will find the win7 version of this sample. It just build the win8 sample in the win8 wdk in a vs build window

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 31, 2013 3:31 PM
  • No you cannot use VS 2010 to build drivers.   Your choices are using VS2012 or using the Windows 7 WDK which has an integrated compiler.  The Win7 WDK does not support all of Win8 and you will still need VS2012 is you want to submit your drivers to WHQL.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, January 30, 2013 12:26 PM
  • There are two build environments Checked and Free checked is the debug version of the driver and free is the release version.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, February 6, 2013 11:39 AM

All replies

  • I have tried it but it does not work at my end. Might be someone from MS clarify.
    Wednesday, January 30, 2013 10:44 AM
  • No you cannot use VS 2010 to build drivers.   Your choices are using VS2012 or using the Windows 7 WDK which has an integrated compiler.  The Win7 WDK does not support all of Win8 and you will still need VS2012 is you want to submit your drivers to WHQL.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, January 30, 2013 12:26 PM
  • Try out the Visual DDK add-on to VS2010. I  tried briefly only and it seem to be OK but no warranty. Our serious project is VS2012-based.

    It costs nothing to download and try Visual DDK out - it's a freeware, check out their web site:

    http://visualddk.sysprogs.org
    Wednesday, January 30, 2013 1:35 PM
  • The package being referenced is for the Windows 7 WDK.  And while it works fine if you have it drive the ddkbuild macro (i.e. run the standard BUILD in the Win7 WDK) it can have subtle problems that when used with the mode that tries to build directly with VS2010.  Most of the professional developers I know would never ship a driver built with that approach since it is not recognized as safe. 


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, January 30, 2013 1:56 PM
  • Hi Donald, 

    Thank you very much for your inputs. 

    I tried compiling diskperf sources on Windows Server 2003 SP2 (32 bit) using Win WDK, I get below messages. 

    C:\sample_driver\C++\src>build

    BUILD: Compile and Link for x86
    BUILD: Loading c:\winddk\7600.16385.1\build.dat...
    BUILD: Computing Include file dependencies:
    BUILD: Start time: Thu Jan 31 10:42:15 2013
    BUILD: Saving c:\winddk\7600.16385.1\build.dat...
    BUILD: Finish time: Thu Jan 31 10:42:16 2013
    BUILD: Done

    But no .sys files or inf files are generated. I checked the buildfre_wnet_x86.log, it only says, 

    "BUILD: Computing Include file dependencies:" and there are no messages after that.

    Should i do any settings before i start using WDK for compiling the sources?

    I had one more question. Can i build diskperf on a 64 bit machine by setting the project platform to x86, and then use the built driver binaries on a 32 bit machine? 

    Please guide me on this. 

    Thanks!



    Thursday, January 31, 2013 5:31 AM
  • Is there a sources file in the directory? If so, post the contents

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 31, 2013 8:06 AM
  • The diskperf folder has 2 folders 

    (1) C++

    (2) description

    C++ has

    (1) src folder and 

    (2) diskperf.sln file.

    src folder has below files:

    (1) diskperf.c

    (2) diskperf.inf

    (3) diskperf.rc

    (4) diskperf.vcxproj

    i tried compiling by entering into all the directories present under diskperf, but same result. 

    Thanks!

    Thursday, January 31, 2013 9:21 AM
  • You have the win8 sample, you can't build it with the win7 kit. Under the the win7 kit root, under src, you will find the win7 version of this sample. It just build the win8 sample in the win8 wdk in a vs build window

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 31, 2013 3:31 PM
  • Thank You very much Doron. It worked!!

    Monday, February 4, 2013 9:10 AM
  • Hi Doron, 

    Using Win 7 DDK kit, how do i build the driver in debug mode?

    I believe we need set few flags while compilation, so that driver builds in debug mode. 

    Please let me know the options.

    Many Thanks...


    Wednesday, February 6, 2013 10:36 AM
  • There are two build environments Checked and Free checked is the debug version of the driver and free is the release version.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, February 6, 2013 11:39 AM
  • Thanks Donald.

    I want to view the debug prints of my driver on the local machine (Windows server 2003) where i have built/installed the driver. 

    I followed below steps:

    (1) Executed "bootcfg /debug ON /ID 1" to enable local debugging.

    bootcfg command gave the below output after the system reboot.

    C:\>bootcfg
    Boot Loader Settings
    --------------------
    timeout:30
    default:multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

    Boot Entries
    ------------
    Boot entry ID:    1
    OS Friendly Name: Windows Server 2003, Enterprise
    Path:             multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    OS Load Options:  /noexecute=optout /fastdetect /debug

    (2) Installed the driver built using "checked x86" option.

    (3) Installed DebugView utility, and did the below:

    (a) Selected the option to save the log file.

    (b) Selected, Capture -> “Log Boot”

    (c) Selected, Capture -> “Capture Kernel”

    (d) Selected, Options -> “Clock Time”

    When the system rebooted, i opened debugview to see if there was any debug messages. 

    Only one message was logged: 

    AFD: AfdPprThreshold value queried from transport: 2960

    There was no messages from my driver. 

    Should i do any additional changes to see the driver debug prints?



    Wednesday, February 6, 2013 12:08 PM
  • It is never recommended to install a driver under development on the machine you are using to develop that driver

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, February 6, 2013 2:54 PM