OSRLogoOSRLogoOSRLogo x OSR Custom Development Services

Everything Windows Driver Development

GoToHomePage xLoginx

    Thu, 14 Mar 2019     118020 members


  Online Dump Analyzer
OSR Dev Blog
The NT Insider
The Basics
File Systems
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

Building Within Visual Studio (IDE)

There's nothing wrong with building drivers from within Visual Studio. But if you do this, do it right or don't do it at all.

The only way to properly build drivers from within the IDE is to use what Visual Studio calls an "external build procedure" to compile and link your drivers using the tools provided with the DDK. That means you run BUILD, just like you would from the command line, but directly from within Visual Studio. You get your browse files, you get your syntax completion, and you get a build environment that's supported.

It is either arrogance or unadulterated stupidity to attempt to recreate the DDK's build environment by setting up all the options, defines, and paths within your own Visual Studio project. Why would you do this, when you can do it as described above and get the same result correctly? Not only trying to define your own environment results in using the wrong compiler in XP, but you'll also use the wrong linker in Win2K. Also, note that defines, paths, and options actually can change from release to release of the DDK.

So, if you want to use the IDE, do it right or use BUILD.

Related Articles
Don't Define NT_UP
Just Checking - Installing a Partially Checked Build
Taming the Beast - The Windows 2000 Build Environment
Build Tricks: Checked and Free Revisited
Save the Environment! - Integrating Build and Developer Studio
If You Build It - Visual Studio and Build Revisited
Warning: Beware winioctl.h from Visual C/C++ Version 6.0
New Build Definitions?
Definition of DDKBUILDENV Changed in Windows XP®
Definition of “CPU” Environment Variable Changed

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

"Well, no."
Using the procedure you outlined is BAD ENGINEERING PRACICE. It's precisely what we're trying to warn people about.

If you use the process you describe, you've got the switches and settings right for ONE version of the DDK, and now you've got those switches and settings embedded in your VS project. What happens when a new DDK is released, and those switches CHANGE? Suppose the switches change (as they do) from build environment to build environment??

No, dude, bad idea. THAT's why we describe this process.

10-Mar-05, Peter Viscarola

"building driver with Visual Studio"
'The only way to properly build drivers from within the IDE is to use what Visual Studio calls an "external build procedure" to compile and link '

Not true. Set the project settings to ignore default directories for compile and link. Set all other neccessary switches. In Tools-Options-Directories-Executable Files, add a path to the DDK bin and move it to the top of the list. Copy BSCMAKE.EXE to the DDK bin dir.

You can now build drivers with browse info etc from VS.

10-Mar-05, matt sykes

Post Your Comments.
Print this article.
Email this article.
bottom nav links