Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB

  1. #ifndef _DEBUG_
  2. #define _DEBUG_
  3. #if DBG
  4. #define DEBUG DBG
  5. #endif
  6. //
  7. // Debug Levels used with DBGPRINT
  8. #define DBG_LEVEL_INFO 0
  9. #define DBG_LEVEL_WARN 1
  10. #define DBG_LEVEL_ERR 2
  11. #define DBG_LEVEL_FATAL 3
  12. // Component Types
  13. #define DBG_COMP_INIT 0x00000001
  14. #define DBG_COMP_DPC 0x00000002
  15. #define DBG_COMP_REGISTRY 0x00000004
  16. #define DBG_COMP_MEMORY 0x00000008
  17. #define DBG_COMP_SEND 0x00000010
  18. #define DBG_COMP_REQUEST 0x00000020
  19. #define DBG_COMP_MISC 0x00000040
  20. #define DBG_COMP_ALL 0xffffffff
  21. extern LONG LoopDebugLevel;
  22. extern LONG LoopDebugComponent;
  23. #ifdef DEBUG
  24. #define DBGPRINT(Component, Level, Fmt) \
  25. if ((LoopDebugComponent & Component) && (Level >= LoopDebugLevel)) { \
  26. DbgPrint(" *** Loop - "); \
  27. DbgPrint Fmt; \
  28. }
  29. #define DBGBREAK(Level) \
  30. if (Level >= LoopDebugLevel) { \
  31. DbgBreakPoint(); \
  32. }
  33. #else
  34. #define DBGPRINT(Component, Level, Fmt)
  35. #define DBGBREAK(Level)
  36. #endif
  37. #endif // _DEBUG_