The build process also generates a file called Wdm1.dbg with the debug symbols in the OBJi386free directory.
Windows 2000
In W2000,
Wdm1 Directories
The end result is the following series of subdirectories for Wdm1.
Directory | Contents |
---|---|
OBJ | Has |
OBJi386 | W98 Compiled object files |
OBJi386free | W98 Free build Wdm1.sys |
OBJi386checked | W98 Checked build Wdm1.sys |
OBJFREi386 | W2000 Free build objects and Wdm1.sys |
OBJCHKi386 | W2000 Checked build objects and Wdm1.sys |
Another makefile called makefile.inc is invoked if you use certain optional macros in the SOURCES file. Table 4.2 shows the macro name and when the make target is invoked.
Table 4.2 SOURCES optional macros
SOURCES macro name | When invoked |
---|---|
NTTARGETFILE0 | after dependency scan |
NTTARGETFILE1 | before linking |
NTTARGETFILES | during link |
Listing 4.3 shows the standard makefile.inc that is used in all the book software projects.
Listing 4.3 Book software projects makefile.inc
PostBuildSteps: $(TARGET)
!if '$(DDKBUlLDENV)'='free'
rebase –B 0x10000 –X . $(TARGET)
!endif
copy $(TARGET) $(WINDIR)system32drivers
The line in the Wdm1 SOURCES file that says NTTARGETFILES=PostBuildSteps ensures that the target PostBuildSteps is built during the link process. As the PostBuildSteps target depends on $(TARGET) — the driver executable — the build commands for PostBuildSteps are carried out after the driver is built. The PostBuildSteps output is displayed in the build.log file. Note that problems in PostBuildSteps may not evident unless you inspect this file.
The actual post-build steps in makefile.inc do two jobs. First, the
The final main feature of
The book software base directory has a DIRS file with the following line:
DIRS=Wdm1 Wdm2 WdmIo UsbKbd HidKbd DebugPrint PassThru
Running
The directories listed in the DIRS directive must be only one level below the current directory. Therefore, the Wdm1 directory has a DIRS file that instructs
VC++ Projects
You can set up VC++ to build drivers from within Visual Studio. It is possible to configure a project's settings so that Visual Studio can compile your driver directly. However, it is laborious changing all the settings and is error prone. The final problem is that Microsoft might change driver compile or link requirements in the DDK standard makefile. Such changes would not be reflected automatically in your settings.
The best way therefore is to use a
The book software projects are set up already to use the
You might find it useful to select the
When you make a new