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.

72 lines
1.8 KiB

  1. // Copyright (c) 1999-2000 Microsoft Corporation
  2. #ifndef _DEBUG_H_
  3. #define _DEBUG_H_
  4. extern ULONG DebugLevel;
  5. //
  6. // Debugging Macros
  7. //
  8. #define DBG_OFF ((ULONG)0x00000000)
  9. #define DBG_ERR ((ULONG)0x00000001)
  10. #define DBG_WRN ((ULONG)0x00000002)
  11. #define DBG_INIT ((ULONG)0x00000004)
  12. #define DBG_PNP ((ULONG)0x00000008)
  13. #define DBG_READ ((ULONG)0x00000010)
  14. #define DBG_WRITE ((ULONG)0x00000020)
  15. #define DBG_DUMP_READS ((ULONG)0x00000040)
  16. #define DBG_DUMP_WRITES ((ULONG)0x00000080)
  17. #define DBG_READ_LENGTH ((ULONG)0x00000100)
  18. #define DBG_WRITE_LENGTH ((ULONG)0x00000200)
  19. #define DBG_USB ((ULONG)0x00000400)
  20. #define DBG_SERIAL ((ULONG)0x00000800)
  21. #define DBG_TIME ((ULONG)0x00001000)
  22. #define DBG_EVENTS ((ULONG)0x00002000)
  23. #define DBG_CANCEL ((ULONG)0x00004000)
  24. #define DBG_IRP ((ULONG)0x00008000)
  25. #define DBG_INT ((ULONG)0x00010000)
  26. #define DBG_DUMP_INT ((ULONG)0x00020000)
  27. #define DBG_WORK_ITEMS ((ULONG)0x00040000)
  28. // ...
  29. #define DBG_LOCKS ((ULONG)0x00100000)
  30. #define DBG_TRACE ((ULONG)0x00200000)
  31. // ...
  32. #define DBG_PERF ((ULONG)0x80000000)
  33. // ...
  34. #define DBG_ALL ((ULONG)0xFFFFFFFF)
  35. #if DBG
  36. #ifndef DRV_NAME
  37. #define DRV_NAME "WCEUSBSH"
  38. #endif
  39. #define DbgDump(_LEVEL, _STRING) \
  40. { \
  41. ULONG level = _LEVEL; \
  42. if ( DebugLevel & level ) { \
  43. DbgPrint("%s(%d): ", DRV_NAME, KeGetCurrentIrql() ); \
  44. DbgPrint _STRING; \
  45. } \
  46. }
  47. //
  48. // these should be removed in the code if you can 'g' past these successfully
  49. //
  50. #define TEST_TRAP() \
  51. { \
  52. DbgPrint( "%s: Code Coverage Trap: %s %d\nEnter 'g' to continue.\n", DRV_NAME, __FILE__, __LINE__); \
  53. DbgBreakPoint(); \
  54. }
  55. #else // !DBG
  56. #define DbgDump(LEVEL,STRING)
  57. #define TEST_TRAP()
  58. #endif // DBG
  59. #endif // _DEBUG_H_