Compartilhar via


Building a Sample Driver

Although the Build utility has a great number of features--and some of them are rather obscure--it is very easy to begin using this utility to build useful binaries.

To build a single WDK sample driver

  1. Open a build environment window. The command prompt appears with the DDK installation directory as its current directory.

  2. Change to the src subdirectory of the Windows Driver Kit (WDK) directory. Within this directory are all the samples. Navigate to the subdirectory that contains the sample you want to build.

  3. Invoke the Build utility with the /cZg switch, as in the following example:

    E:\DDK> cd src
    E:\DDK\src> cd wdm\AVStream\avssamp
    E:\DDK\src\wdm\AVStream\avssamp> build /cZg
    

The /cZg switch creates a clean build of the samples (by deleting all pre-existing .obj files). It also prevents the dependency checking of source and header files. For other available options, see Build Utility Command-Line Parameters and Using Macros and Environment Variables. The Sources file lets the Build utility know what to build.

To build all samples at once

  1. Open a build environment window. The command prompt opens with the WDK installation directory as its current directory.

  2. Change to the src subdirectory of the WDK directory.

  3. Invoke the Build utility with the /cZg switch, as in the following example:

    E:\DDK> cd src
    E:\DDK\src> build /cZg
    

The Dirs files in the sample tree instruct the Build utility on how to recurse through the entire tree.

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011