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.

149 lines
4.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: debug.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 9-21-94 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __DEBUG_H__
  18. #define __DEBUG_H__
  19. #include <dsysdbg.h>
  20. // The following Debug Flags can be turned on to trace different areas to
  21. // trace while executing. Feel free to add more levels.
  22. #define DEB_TRACE_VERB 0x00000008 // Verbose tracing (parameter dumps)
  23. #define DEB_TRACE_WAPI 0x00000010 // Trace Worker APIs
  24. #define DEB_TRACE_HELPERS 0x00000020 // Trace SPHelp functions
  25. #define DEB_TRACE_RM 0x00000040 // Trace Reference Monitor stuff
  26. #define DEB_TRACE_INIT 0x00000080 // Trace initialization msgs
  27. #define DEB_TRACE_SCAV 0x00000100 // Trace scavenger operations
  28. #define DEB_TRACE_CRED 0x00000200 // Trace supp. credentials
  29. #define DEB_TRACE_LSA_AU 0x00000400 // Trace LSA AU functions
  30. #define DEB_TRACE_LPC 0x00000800 // Trace LPC stuff
  31. #define DEB_TRACE_NEG 0x00001000 // Trace Negotiate functions
  32. #define DEB_TRACE_SAM 0x00002000 // Trace SAM hooks
  33. #define DEB_TRACE_LSA 0x00004000 // Trace LSA support for DS
  34. #define DEB_TRACE_SPECIAL 0x00008000 // Trace Special stuff
  35. #define DEB_TRACE_QUEUE 0x00010000 // Trace queue and tasks
  36. #define DEB_TRACE_HANDLES 0x00020000 // Trace handle code
  37. #define DEB_TRACE_NEG_LOCKS 0x00040000 // Trace negotiate locks
  38. #define DEB_TRACE_AUDIT 0x00080000 // Trace audit activity
  39. #define DEB_TRACE_EFS 0x00100000 // Trace EFS functions
  40. #define DEB_LOG_ONLY 0x80000000 // Do not log this to the debugger
  41. #define DEB_BREAK_ON_ERROR 0x40000000 // BreakOnError macro enabled (see below)
  42. // The following flags control when the SPM will raise breakpoints for
  43. // debugging through a remote debugger. Setting these bits on and enabling
  44. // DEB_BREAK_ON_ERROR will cause a breakpoint at the following conditions
  45. #define BREAK_ON_BEGIN_INIT 0x01 // Break point at beginning of init
  46. #define BREAK_ON_BEGIN_END 0x02 // Break point at complete of init
  47. #define BREAK_ON_P_CONNECT 0x04 // Break at process connect
  48. #define BREAK_ON_SP_EXCEPT 0x08 // Break if a package causes an exception
  49. #define BREAK_ON_PROBLEM 0x10 // Break if a serious problem occurs
  50. #define BREAK_ON_SHUTDOWN 0x20 // Break on beginning of shutdown
  51. #define BREAK_ON_LOAD 0x40 // Break when a package is loaded
  52. //
  53. // Negotiation specific debugging
  54. //
  55. #define DEB_TRACE_LOCKS 0x00000010
  56. #if DBG
  57. // Debugging support prototypes:
  58. void InitDebugSupport(void);
  59. void LogEvent(long, const char *, ...);
  60. extern SECPKG_FUNCTION_TABLE DbgTable;
  61. DECLARE_DEBUG2(SPM);
  62. DECLARE_DEBUG2(Neg);
  63. extern DWORD BreakFlags; // Breakpoints
  64. #define DebugLog(x) SPMDebugPrint x
  65. #define DebugLogEx(x) SPMDebugPrint x
  66. #define NegDebugLog(x) NegDebugPrint x
  67. #define DebugStmt(x) x
  68. #define BreakOnError(x) \
  69. if ((x & BreakFlags) && \
  70. (SPMInfoLevel & DEB_BREAK_ON_ERROR)) \
  71. { \
  72. DebugLog((DEB_BREAK_ON_ERROR, "Breakpoint requested\n" )); \
  73. DbgUserBreakPoint(); \
  74. }
  75. #define ASSERT_CONTINUE 0
  76. #define ASSERT_BREAK 1
  77. #define ASSERT_SUSPEND 2
  78. #define ASSERT_KILL 3
  79. #define ASSERT_PROMPT 4
  80. #define ASSERT_DEBUGGER 5
  81. #define SpmAssertEx( exp , ContinueCode ) \
  82. DsysAssertEx( exp, ContinueCode )
  83. #define SpmAssertMsgEx( Msg, exp, ContinueCode ) \
  84. DsysAssertMsgEx( exp, Msg, ContinueCode )
  85. #define SpmAssert(exp) SpmAssertEx(exp, ASSERT_DEBUGGER)
  86. #define SpmAssertMsg(Msg, exp) SpmAssertMsgEx(Msg, exp, ASSERT_DEBUGGER )
  87. #define SpmpThreadStartup() SpmpThreadStartupEx()
  88. #define SpmpThreadExit() SpmpThreadExitEx()
  89. void
  90. SpmpThreadStartupEx(void);
  91. void
  92. SpmpThreadExitEx(void);
  93. #else // Not DBG
  94. #define DebugLog(x)
  95. #define NegDebugLog(x)
  96. #ifdef DBG_ERRORS
  97. void ExLogEvent(long, const char *, ...);
  98. #define DebugLogEx(x) ExLogEvent x
  99. #else
  100. #define DebugLogEx(x)
  101. #endif
  102. #define DebugStmt(x)
  103. #define BreakOnError(x)
  104. #define SpmAssertEx(exp, ContinueCode)
  105. #define SpmAssert(exp)
  106. #define SpmAssertMsg(Msg, exp)
  107. #define SpmAssertMsgEx(Msg, exp, ContinueCode)
  108. #define SpmpThreadStartup()
  109. #define SpmpThreadExit()
  110. #endif
  111. #endif // __DEBUG_H__