Late-Breaking News for the Microsoft® Windows® 2000 DDK

Compaq Alpha not supported on Windows 2000

Driver Verifier

Windows File Protection Driver Signing

Installation Issues

Compiling and Linking

Debugging

WDM 1.0

WDM Audio Drivers

Sample Issues

Tool Issues

Windows® 2000 DDK Build Environment Changes

    The Windows 2000 DDK includes an environment for building drivers that closely matches the internal build environment used to build Windows 2000 drivers at Microsoft®. This environment comes in two types: free and checked.

    The free environment is similar to the Microsoft Visual Studio® concept of retail builds, which are optimized for release. The checked environment has no optimization and often has extra tests in the code to catch errors. All drivers should first be written and tested in the checked environment, and then retested in the free environment after they seem to be complete.

    The Build tool (Build.exe), which is part of both environments, acts as a front end to a standard compilation tool such as Nmake.  Build and the makefiles included in the DDK are customized for creating Windows 2000 drivers. Most drivers do not need to specify their own custom makefile, because a simple makefile that includes the makefile.def in the DDK will suffice. However, to properly set up driver code to compile using Build, you must create a sources file that specifies values for the environment variables that drive Build's actions. The DDK documents how to create this file plus the related dirs file.

    In past versions of Microsoft DDKs, the objects compiled through the build process often ended up in arbitrary locations. The location was defined by the environment variable TARGETPATH. Usually, the location was set to either $(BASEDIR)\lib\<platform>\Free|Checked or to Obj\<platform>, where <platform> could be either I386 or Alpha. The former is confusing to inexperienced users. The latter allowed the user's checked files to be overwritten by the free ones, and vice versa.

    Previously, the common TARGETPATH setting was TARGETPATH=$(BASEDIR)\lib, which is now explicitly disallowed by the code in makefile.def.

    The version of Build included in the Windows 2000 DDK still uses TARGETPATH to place objects created by Build. If TARGETPATH is set to point to a particular directory, the objects created will be placed in that directory. The default for TARGETPATH is OBJ, which is treated by Build as a special token. If TARGETPATH is set to OBJ, the objects will be placed in Obj$(BUILD_ALT_DIR)\<platform>.

    If the environment variable BUILD_ALT_DIR is undefined, the default is Obj\<platform>. In the Windows 2000 DDK, the free environment sets BUILD_ALT_DIR to FRE, and the checked environment sets the variable to CHK. The result is that free build objects are placed in Objfre\<platform> and checked builds are placed in Objchk\<platform>. This allows both a free and checked version to co-exist and be built from the same source. Use the variable $(O) [capital O, not zero] as an easy way to refer to this directory in sources files.

    BUILD_ALT_DIR is also appended to the build logs created by the build -e command. In the DDK environments, this causes the names of the log files to change as follows.

    Default Name

    Free Build Name

    Checked Build Name

    Build.log

    Buildfre.log

    Buildchk.log

    Build.err

    Buildfre.err

    Buildchk.err

    Build.wrn

    Buildfre.wrn

    Buildchk.wrn

    The DDK environment also emulates this same behavior for the libraries included in the DDK. Instead of a single Lib\<platform> directory containing only the free versions of the libraries, there are now two directories: Libfre and Libchk. This allows the DDK to include both the free and checked versions of the libraries. The DDK environment is created using a batch file, setenv.bat, which sets the variables CRT_LIB_PATH, DDK_LIB_DEST, DDK_LIB_PATH, SDK_LIB_DEST, and SDK_LIB_PATH correctly for the free or checked environment.

    The variable TARGETPATHLIB allows you to specify a different location than TARGETPATH for .lib and .exp files created for DLLs. When you are building a DLL, you create the DLL itself. You also create an import library that other images can use to reference functions exported by your DLL. Setting TARGETPATH independently from TARGETPATHLIB allows the binary to be kept in the current directory, while the .lib and .exp files can be shared with other components. TARGETPATHLIB has no effect on binaries that are not DLLs.

    The location of header files has also been changed in the current DDK. Most headers remain in the $(BASEDIR)\inc directory. However, the DDK-specific headers are now in $(BASEDIR)\inc\ddk, and the WDM-specific headers are now in $(BASEDIR)\inc\ddk\wdm. You may need to adjust INCLUDES directives in sources files.

    The following environment variables  included in sources files in the past  are now disallowed:

    • EXEPROFILEINPUT  use NTPROFILEINPUT instead.

    • MAJORCOMP

    • MINORCOMP

    • PNP_POWER 

    These are unneeded, so please remove them from your sources file.

Feedback
    If you find inaccuracies with the DDK, are looking for something not documented in the DDK, or otherwise want to provide feedback, please visit our Windows® 2000 DDK Web site at http://www.microsoft.com/ddk/. The feedback link on this page comes directly to the teams which provide input for these documents. It's your DDK, if you have an issue with it, please let us know.

Top of page

Copyright © Microsoft Corporation 1999