4

I want to write some simple code using DDK - but i don't know even how to compile some demo code that i download.

How to compile this thing ? Is there some simple editor / IDE that i can use ? Is there some way to use visual studio to write and compile DDK ?

Yanshof
  • 9,659
  • 21
  • 95
  • 195

2 Answers2

5

Generally the WDK consists of a command-line tools. No IDE or etc. However with some efforts it's possible to setup the MS standard IDE (MSVC2005/2008/2010).

First download and install the latest WDK package (from the official MS website). Go into StartMenu -> Windows Driver Kits -> WDK xxxx.xxxx.x -> Build Environments.

There you'll find a list of build environments. Each one is just a shortcut to cmd.exe, with plenty of environmental variables set accordingly. Those are build environments for different Windows version, plus for each you have a free/checked configurations, which is equivalent to user-mode's Release/Debug builds.

In order to build the driver you should launch one of those shortcuts. Then, in the command prompt, go into the source code's directory and run build batch command. The rest is determined by the makefile residing in the selected directory.

It is possible nevertheless to use the standard IDE for driver development. That is, use vcproj (or vcxproj in MSVC2010) instead of makefile. This however requires setting many build parameters.

valdo
  • 12,632
  • 2
  • 37
  • 67
1

Currently there are two main paths to choose from:

1. For drivers running on Windows 7 and above:

Since Visual Studio 2013, you can use Visual Studio's built-in integration for working with WDK projects, which is a full blown IDE for driver development.

Sample screenshot from Visual Studio 2015 + WDK 10:

enter image description here

There is also a short guide from Microsoft on what one needs to get started. The guide includes links to downloads of Visual Studio, WDK and samples - Get started with Windows 10, Visual Studio, and the WDK:

Used together, Visual Studio 2015 and WDK 10 provide an integrated development environment for creating efficient, high-quality drivers for devices running Windows 10. This release of Visual Studio includes the Visual Studio Tools for Windows 10 and the Microsoft Windows Software Development Kit (SDK) for Windows 10.

In short you need to install Visual Studio 2015 with Update 1 and WDK 10. Your OS need to be Windows 7 or newer (desktop only, not server).

2. For drivers running on Windows XP:

If you need to stick with older WDK 7.1 (eg. for Windows XP support), then this guide from Donald D. Burn can be a good start - Getting Started with Windows Driver Development:

WDK MVP Donald D. Burn shares his experience and insights about tools for creating a device driver for Microsoft Windows, with information about debugging, testing tools, and techniques that can help you find and fix bugs early in development.

...

Updated with changes to the tools, build environment, and best practices from the Windows Server 2003 Service Pack 1 Windows Driver Kit (WDK) to the Windows Driver Kit (WDK) Version 7.1.

Choosing this path usually requires compiling drivers in command line via Build Environments, as described by valdo's answer. As for coding you can use an editor of your choice.

quasoft
  • 5,291
  • 1
  • 33
  • 37