Building a New Driver

来源:百度文库 编辑:神马文学网 时间:2024/04/29 06:27:16

Building a New Driver

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

After setting the directory, invoke the Build utility with the -cZoption 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 "cleanbuild" (by deleting all pre-existing .obj files) and inhibits dependencychecking of source and header files.

Output files are placed in a subdirectory named either \objfre or\objchk, depending on whether you are using the free or checked buildenvironment.

For more information, see How to Use the BuildUtility.

Building a WDM Driver

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

DRIVERTYPE=WDM

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

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