One issue was reported by Vladimir Zinin in the article about DDKBUILD on OSR Online already back in October 2007. However, since I hadn’t actually built any x64 code with the newer 6001.* WDK, and since Vladimir had mentioned that he used the WNETAMD64 configuration I had basically discarded his comment as a mixup of the wrong WDK/DDK with the respective configuration. Sorry about that, Vladimir. Your comment was right, although the configuration you used was obviously WLHNETX64.
Anyway, the fix proved not to be as easy as anticipated. The problem is, that the WDK team at Microsoft changed the setenv.bat in a way that breaks compatibility between the Vista WDK (6000) and the Windows 2008 Server WDK (6001.18000). Instead of adding the flag x64 for x64 builds, the flag AMD64 was replaced by x64. This makes it a bit tricky. I solved it by introducing a detection of the string “Windows Server Longhorn” inside setenv.bat. Since this file has to be in the ./bin folder inside the base directory of the used WDK, this should be pretty safe. Also, since it has been released now as “Windows 2008 Server” it is unlikely to change back to “Windows Server Longhorn” (at least I hope this!). This brings me to a little rant. The WDK team could easily ignore the base directory parameter and detect it from the location of setenv.bat … but well 😉
… (rant over)
Continue reading