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.

119 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. dbgsys.h
  5. Environment:
  6. Kernel mode
  7. Revision History:
  8. 7-13-2000 : created
  9. --*/
  10. #ifndef _DBG_SYS_
  11. #define _DBG_SYS_
  12. #if DBG
  13. #include <ntpoapi.h>
  14. #define ERROR DPFLTR_ERROR_LEVEL // 0
  15. #define WARN DPFLTR_WARNING_LEVEL // 1
  16. #define TRACE DPFLTR_TRACE_LEVEL // 2
  17. #define INFO DPFLTR_INFO_LEVEL // 3
  18. #define MAXTRACE 5 // processor driver specific
  19. VOID
  20. _cdecl
  21. DebugPrintX(
  22. ULONG DebugLevel,
  23. PUCHAR Format,
  24. ...
  25. );
  26. PUCHAR
  27. PnPMinorFunctionString (
  28. UCHAR MinorFunction
  29. );
  30. PUCHAR
  31. PowerMinorFunctionString (
  32. UCHAR MinorFunction
  33. );
  34. PUCHAR
  35. DbgSystemPowerString (
  36. IN SYSTEM_POWER_STATE Type
  37. );
  38. PUCHAR
  39. DbgPowerStateHandlerType(
  40. IN POWER_STATE_HANDLER_TYPE Type
  41. );
  42. PUCHAR
  43. DbgDevicePowerString (
  44. IN DEVICE_POWER_STATE Type
  45. );
  46. VOID
  47. DisplayPowerStateInfo(
  48. IN ULONG_PTR Arg1,
  49. IN ULONG_PTR Arg2
  50. );
  51. #define TRAP() DbgBreakPoint()
  52. #define DebugPrint(_x_) DebugPrintX _x_
  53. #define DebugAssert(exp) \
  54. if (!(exp)) { \
  55. RtlAssert(#exp, __FILE__, __LINE__, NULL); \
  56. }
  57. #define DebugAssertMsg(exp, msg) \
  58. if (!(exp)) { \
  59. RtlAssert(#exp, __FILE__, __LINE__, msg); \
  60. }
  61. #define DebugEnter() DebugPrint((MAXTRACE, "Entering " __FUNCTION__ "\n"));
  62. #define DebugExit() DebugPrint((MAXTRACE, "Leaving " __FUNCTION__ "\n"));
  63. #define DebugExitStatus(_status_) \
  64. DebugPrint((MAXTRACE, "Leaving " __FUNCTION__ ": status=0x%x\n", _status_));
  65. #define DebugExitValue(_rc_) \
  66. DebugPrint((MAXTRACE, "Leaving " __FUNCTION__ ": rc=%d (0x%x)\n", _rc_, _rc_));
  67. #define TurnOnFullDebugSpew() \
  68. DbgSetDebugFilterState(DPFLTR_PROCESSOR_ID, -1, TRUE);
  69. #else
  70. #define TRAP()
  71. #define DebugAssert(exp)
  72. #define DebugAssertMsg(exp, msg)
  73. #define DebugPrint(_x_)
  74. #define DebugEnter()
  75. #define DebugExit()
  76. #define DebugExitStatus(_status_)
  77. #define DebugExitValue(_rc_)
  78. #define PnPMinorFunctionString
  79. #define DbgSystemPowerString(_x_)
  80. #define DbgDevicePowerString(_x_)
  81. #define WalkProcessorPerfStates(_x_)
  82. #define TurnOnFullDebugSpew()
  83. #define DisplayPowerStateInfo(_x_, _y_)
  84. #endif
  85. #endif