Note concerning DDK versions and Service Packs

(This is a copy of an e-mail sent to Service Pack subscribers on Dec. 26, 2001)

Several of you have inquired about the availability of a service pack that doesn't depend on the WinXp DDK. I wanted to let all of you know that SP-10 will actually work with the Win2K DDK if you're a little brave.

To continue using the old DDK with SP-10, begin by launching FixProj from the WDMBOOK directory. (You may be used to right clicking on a .DSP project file to run FIXPROJ on just that file. This is different -- you're launching FIXPROJ like an application.)

The FIXPROJ dialog has two portions. The topmost pane of the window concerns profiles for altering Visual C++ projects, and the lower pane allows you to select project file(s) for modification. In the topmost pane, a red asterisk marks the current profile, which is the one applied when you press the Fix button in the lower pane or when you run FIXPROJ on a single project file. One of the things you could do is mouse click on the DDK2K profile and press the Select button to make the Windows 2000 DDK profile current. Then, you could check the WDMBOOK folder in the lower pane to select all driver projects in my sample set. Pressing Fix will then change all the project options to ones appropriate to the Win2K DDK instead of the WinXp DDK.

Or that's the way it's supposed to work. I used FIXPROJ to change all my samples and production drivers to the new DDK earlier this year, and I use it regularly to add the finishing touches to the raw project left behind by WDMWIZ. But I always use it with the DDKXP-XP profile. I haven't tried the procedure I just described to switch *back*, and the procedure may go awry in some large or small way. That's why I suggested that a little bravery might be required -- you might end up with projects that generate compiler or linker errors. If so, you have two options: (a) restore the original project file, which is still there with a ".sav" file extension, or (b) edit the project settings in Visual Studio to make them work. If you actually solve a problem like this, please e-mail me to tell me what you did so I can post advice for your fellows. But please don't e-mail me to just ask how to fix build problems if you go down this path: part of learning how to write drivers is also learning how to fix little problems in the build environment.

If you're really adventurous, you can create your own project profiles or edit the existing ones using the Edit and New buttons. You're absolutely on your own if something goes wrong, though. Well, you're on your own except for the hint that, in the C++ and linker option pages of the wizard, you can use INS and DEL to add and remove options, and you can double click in the C[hecked] and [F]ree columns to make an option apply to one or both builds.

Now for the $64,000 question.* Why would I try so hard to make you switch to the Xp DDK? The Xp kit includes a special version of the Visual C++ compiler that is the *only* one Microsoft certifies for use in building drivers. Other versions of the compiler may have code generation bugs that will show up in the Free build. The new compiler has language features to help you avoid calling kernel functions that will cause you to flunk WHQL tests later on, and it also supports intrinisic expansions of the InterlockedOr, InterlockedAnd, and InterlockedXor functions. There are certainly other improvements in this compiler that I'm not aware of, too. To get full benefit from this compiler, you also need to use the Xp version of all the DDK header files.

The bottom line here is that you should *want* to switch to the Xp kit, and the most recent service packs have attempted to anticipate your want. You can't, however, download the Xp kit free because it includes the compiler. I submit that the cost of the kit is trivial in comparison with the benefit you'll gain from switching. You can still build drivers for Win2K, WinMe, and Win98 using this kit, too. The only real downside is that you have to slightly modify the way you launch Visual Studio if you plan to build applications and drivers on the same computer, but all of this is covered in detail in WDMBOOK.HTM.

--

* - "The $64,000 Question" was a TV quiz show popular in the fifties, before we learned that these quiz shows were rigged. This was a lot of money in those days.