Debugging Tools for Windows

Building WdbgExts Extensions

All debugger extensions should be compiled and built with the Build utility. The Build utility is included in the Windows Driver Kit (WDK) and in earlier versions of the Windows DDK.

For more information on the Build utility, see the WDK documentation.

Note the following points:

To build a debugger extension
  1. Open the window for the latest Windows build environment. (You can choose either the "free" version or the "checked" version — they will give identical results unless you have put #ifdef DBG statements in your code.)
  2. Set the variable _NT_TARGET_VERSION to indicate the oldest version of Windows on which you want to run the extension. _NT_TARGET_VERSION can be set to the following values.
    Value Versions of Windows
    _NT_TARGET_VERSION_WIN2K Windows 2000 and later.
    _NT_TARGET_VERSION_WINXP Windows XP and later.
    _NT_TARGET_VERSION_WS03 Windows Server 2003 and later.
    _NT_TARGET_VERSION_LONGHORN Windows Vista and later.

    If _NT_TARGET_VERSION is not set, the extension will only run on the version of Windows for which the build window was opened (and later versions). For example, putting the following line in your Sources file will build an extension that will run on Windows XP and later versions of Windows:

    _NT_TARGET_VERSION = $(_NT_TARGET_VERSION_WINXP)

  3. 3.Set the DBGSDK_INC_PATH and DBGSDK_LIB_PATH environment variables to specify the paths to the debugger SDK headers and the debugger SDK libraries, respectively. If %debuggers% represents the root of your Debugging Tools for Windows installation, these variables should be set as follows:

    set DBGSDK_INC_PATH=%debuggers%\sdk\inc
    set DBGSDK_LIB_PATH=%debuggers%\sdk\lib

    If you have moved these headers and libraries to a different location, specify that location instead.

  4. 4.Change the current directory to the directory that contains your extension's Dirs file or Sources file.
  5. 5.Run the Build utility:

    build -cZMg

For a full explanation of these steps, and for a description of how to create a Dirs file and a Sources file, see the Build utility documentation in the WDK.

Build machine: CAPEBUILD