DDK
W
i
zard v1.3.0 Manual
How to use DDK
W
i
zard
• License
• Setup of DDKBUILD
• Usage of the wizard
• Configuration of the wizard
• Tech-speak ...
• Creating custom project templates
• Frequently Asked Questions (FAQ)
• Figures
May the source be with you, stranger ... ;-)
Created: 2009-12-05
Author: Oliver Schneider
Copyright
c
2006-2009 Oliver Schneider (assarbad.net)
$Id: DDKWizard_Help.tex 42 2009-12-05 20:09:32Z oliver $
Trademarks appear throughout this text without any trademark symbol; they are the property of their respective
trademark owner. There is no intention of infringement; the usage is to the benefit of the trademark owner.
DDK
W
i
zard v1.3.0 Manual Preface
Preface
DDK
W
i
zard was written because I can be very lazy, plain and simple!
It is a laziness that is so irrational if you think about it twice. Programmers tend to spend hours to
solve a problem generically
TM
instead of solving it specifically and tailored to the specific problem
within a few minutes (but potentially over and over again with only slight changes). I guess it is
similar to proper code versus spaghetti code, writing and calling a function with parameters versus
writing numerous similar functions.
When I started using OSRs DDKBUILD.BAT script
1
I soon thought I could rewrite it to make use of
all these neat tricks that are allowed by the NT script interpreter
2
and also add some additional
features. You can just download the original version (.bat) as well as the rewritten one (.cmd)
from OSR Online
3
or from the DDK
W
i
zard website at ddkwizard.assarbad.net. Soon, however,
the need for generic DDKBUILD project creation became “overwhelming” ...
As a side-note: There is another
4
DDKBUILD script from Mark Roddy at www.hollistech.com that
does mostly the same as the two scripts from OSR. However, I did not take the time to check the
compatibility issues that may arise from usage of DDK
W
i
zard together with this DDKBUILD “flavor”.
If someone ever does it, please let me know and I will probably modify DDK
W
i
zard to incorporate
the necessary settings. Currently it relies on the fact that the batch and the NT script versions
from OSR take the same arguments, so using it with “the other” DDKBUILD is not recommended,
but of course you can try it if you are curious.
Compatibility
DDK
W
i
zard works with the DDKs of Windows XP, Windows 2003 Server and newer WDKs
5
. It
does not include any configurations for WDF projects and may never include them in future. I’ll
just wait for feedback before deciding about it.
It is compatible with Visual Studio .NET, Visual Studio .NET 2003, Visual Studio 2005 and 2008
and the Express Editions of Visual C++ 2005 and 2008. The “normal” Visual C++ versions are
supposed to work fine as well. Refer to section 2.5 and section 3.1 for some possible limitations
depending on your Visual Studio version.
Visual Studio 2005 and 2008 (and their flavors) support all DDK
W
i
zard features!
1
Which was a traditional batch script.
2
The NT script interpreter goes indeed far beyond what batch provides!
3
You need to be logged on to download the files.
4
... as far as I know the continuation of the very first DDKBUILD script.
5
Tested up to and including the 7600.16385.0 WDK.
c
2006-2009 Oliver Schneider 1 Revision: 42
DDK
W
i
zard v1.3.0 Manual Preface
Prerequisites
DDKBUILD: First of all you need to set up your copy of DDKBUILD according to the version that you
downloaded. It may sound strange (and “narcistic”), but I recommend to use the NT script
(.cmd) version since it provides extra functionality (see subsection 1.2.1) which can be handy
sometimes. Setup of the batch version is explained in section 1.1, while the NT script version
is explained in section 1.2. Both require roughly the same steps.
Laziness: You need to be extraordinarily lazy
6
to even install this wizard! If you are not lazy
enough, that is below 7 on a laziness scale from 1 to 10, you must not use this wizard.
Warning: having this wizard installed on your workstation in your company will
be a clear hint to your boss that you are lazy. So be careful when installing and
using it ;-).
7
How to use this manual
If you are viewing this document in a PDF viewer, you can take advantage of the clickable elements
such as links to external websites and links between chapters and sections - click the chapter, section
or footnote numbers to see the referenced item. Also if you visit the Contents at the end of this
document you can click the items there (not the page numbers, though). This should make it easier
for you to navigate the document and follow back and forward references which occur every now
and then — yet it leaves the document in a state where it can be printed out conveniently.
Kindly note that I use the terms WDK and DDK interchangeably, but unless I want to refer to a
specific version, I try to stick to the traditional term DDK.
Do you like DDK
W
i
zard? Donations & contributions
If you like DDK
W
i
zard, please consider donating to any charity organization you like and trust. But
don’t feel forced, I wrote it primarily to satisfy my own laziness and the laziness of others ;-).
Also, you will certainly help a lot by providing feedback about possible bugs, feature requests and
of course praise. Contributions (new templates, better source files in existing templates)
are very welcome.
Website
The website of DDK
W
i
zard is at ddkwizard.assarbad.net. There you will find this documentation
for download as well as the latest version of the templates and their installer.
An advice
I’d just like to point out how much I liked the two seminars with Mark from OSR and send some
greetings to him and the other guys over at OSR. I like the published books, the mailing lists, The
NT Insider and their commitment to the NT driver community! If you have to work with drivers
professionally you have to take at least one of their seminars
8
- you have to!
6
And for those who didn’t get it just yet - yes, this is a joke.
7
Luckily my current employer accepts this form of laziness in exchange for the increased productivity ;-).
8
... and not be too shy to ask a lot of “stupid” questions ;-)
c
2006-2009 Oliver Schneider 2 Revision: 42
DDK
W
i
zard v1.3.0 Manual License
License
The following license applies to all parts of DDK
W
i
zard, except for any actual project templates,
which are released into the PUBLIC DOMAIN - see below.
Copyright (c) 2006-2009 by Oliver Schneider (assarbad.net)
This software is provided ’as-is’, without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use
of this software.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
The included project templates are all in the PUBLIC DOMAIN, but the same disclaimer, as stated in
the above license, applies:
This software is provided ’as-is’, without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Actually the files, once you create a project with DDK
W
i
zard, will contain your copyright if you
configured the values for Author and CompanyName as described in subsection 3.2.3 and you have
at least Visual Studio 2005. No restrictions apply to created projects.
Including DDK
W
i
zard in computer magazines, etc.
Apart from above license and disclaimers, there are no restrictions if you intend to include DDK
W
i
zard
on software collections or distributing it with computer magazines. If you include it in computer
magazines I would like to hear from you and it’d be nice if you would send me an author’s copy,
but neither is required.
Along with this I should mention that you are of course allowed to redistribute DDK
W
i
zard on your
websites as well. If you redistribute DDK
W
i
zard on your websites, please contact me if you are
interested in serving always the latest version.
c
2006-2009 Oliver Schneider 3 Revision: 42
DDK
W
i
zard v1.3.0 Manual Setup of DDKBUILD
Chapter 1
Setup of DDKBUILD
1.1 DDKBUILD.BAT
This is the classic. DDKBUILD.BAT is easily installed by following these few steps:
1. Download DDKBUILD.BAT from ddkwizard.assarbad.net or this page.
2. Copy DDKBUILD.BAT into a directory where you want it to reside. I usually choose a direc-
tory that can be accessed from anywhere else. Let us say you have the DDKs for Windows
XP and 2003 installed and they are located in C:\WINDDK\2600 and C:\WINDDK\3790.1830
respectively. Now you could copy DDKBUILD.BAT into the common root folder of your DDKs,
in your case C:\WINDDK.
3. Append the path of the directory where DDKBUILD.BAT resides to the PATH variable of either
your user account or to the system-wide PATH variable. In either case right-click My Computer
and choose Properties. Then go to the Advanced page and click Environment Variables. There
you can add or edit the PATH variable of the system
1
or your user account. Figure 7.1 shows
the dialog. Leave the dialog open for item 5.
Note: Leaving out this step will still enable you to use DDKBUILD.BAT from within your IDE
but will prevent you from using it conveniently from the command line.
4. Start up your Visual Studio
2
IDE and from the Tools menu choose Options and in the left
navigation pane choose the folder Projects and Solutions and then VC++ Directories. From
the combobox Show directories for choose Executable files and add the path of the directory
where DDKBUILD.BAT resides here as well. Figure 7.2 shows the dialog. This step is optional
if you set the PATH according to the previous step.
5. Depending on the DDKs you have installed, you should set the variables
3
(using the dialog
opened before, in point 3) with the following names to point to the respective directories
4
:
• Windows XP DDK:
For this DDK set the variable WXPBASE to point to the base directory of your Windows
XP DDK. A usual location is C:\WINDDK\2600.
1
... if you are an administrator.
2
Referring to Visual Studio I mean specifically Visual C++.
3
It is your choice whether you set the system-wide variables or those for your user account.
4
For the NT4 DDK you can use the NT4BASE variable, for the Windows 2000 DDK the W2KBASE variable. However,
this is not supported by DDK
W
i
zard, W2KBASE was supported before version 1.3.0.
c
2006-2009 Oliver Schneider 4 Revision: 42