Previous Next

Building a New Driver

To build a driver, open a build environment, then use the cd command to set your default directory to one containing a sources file or a dirs file.

After setting the directory, invoke the Build utility with the -cZ option as in the following example:

E:\NTDDK>cd mydriver\src
E:\NTDDK\mydriver\src>build -cZ

Running build -cZ compiles and links your driver. It creates a clean build (by deleting all preexisting .obj files) and inhibits dependency checking of source and header files.

Output files are placed in a subdirectory whose name is based on the build environment type, the platform, and the Windows version for which they are built. See Specifying the Location of Created Files for details.

For more information, see How to Use the Build Utility.

Building a WDM Driver

To build a WDM driver, use the DRIVERTYPE macro in your sources file:

DRIVERTYPE=WDM

When this macro is set, the Build utility sets the path for include files equal to the value of WDM_INC_PATH instead of DDK_INC_PATH. This means that the WDM-only header files will be used in your driver.

For information about creating drivers that will run on multiple versions of WDM, see Determining the WDM Version and Differences in WDM Versions.