3gipnet 发表于 2015-12-16 10:52:20

Windows Driver Kit DBG宏

Windows Driver Kit: Driver Development Tools

Conditional Compilation and the Build Environment  You should conditionally compile the debugging code in your driver by testing the DBG preprocessor constant.
  The value of DBG depends on the build environment window you use to build your driver:


[*]If you create your driver by running the Build utility in a checked build environment, DBG will equal 1.
[*]If you create your driver by running the Build utility from a free build environment, DBG will equal 0 (or will be undefined if neither wdm.h nor ntddk.h is included).
  

  The debugging routines ASSERT, ASSERTMSG, KdBreakPoint, KdBreakPointWithStatus, KdPrint, and KdPrintEx are actually macros that are conditionally defined depending on the value of DBG. If it is 0, these macros are no-ops. Therefore, these macros are active only in the checked build of a driver.
  NoteAll debugging routines beginning with the letters "Kd" have no effect in a free build of a driver, except for KdRefreshDebuggerNotPresent.
  For more information about the build environments that allow you to create free and checked builds of a driver, see Setting Up the Build Environment.
页: [1]
查看完整版本: Windows Driver Kit DBG宏