Leaked source code of windows server 2003
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.

134 lines
4.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: debug.hxx
  7. //
  8. // Contents: Debug definitions that shouldn't be necessary
  9. // in the retail build.
  10. //
  11. // History: 19-Nov-92 WadeR Created
  12. //
  13. // Notes: If you change or add a debug level, also fix debug.cxx
  14. //
  15. //--------------------------------------------------------------------------
  16. #ifndef __DEBUG_HXX__
  17. #define __DEBUG_HXX__
  18. #include "sectrace.hxx"
  19. #ifdef RETAIL_LOG_SUPPORT
  20. DECLARE_DEBUG2(KDC)
  21. #define DEB_T_KDC 0x00000010
  22. #define DEB_T_TICKETS 0x00000020
  23. #define DEB_T_DOMAIN 0x00000040
  24. #define DEB_T_TRANSIT 0x00000100
  25. #define DEB_T_PERF_STATS 0x00000200
  26. #define DEB_T_PKI 0x00000400
  27. #define DEB_T_SOCK 0x00001000
  28. #define DEB_T_TIME 0x00002000 // starttime, endtime, renew until
  29. #define DEB_FUNCTION 0x00010000 // function level tracing
  30. #define DEB_T_PAPI 0x00100000
  31. #define DEB_T_U2U 0x00200000
  32. #define DEB_T_PAC 0x00400000
  33. #define DEB_T_KEY 0x00800000
  34. #define DEB_T_S4U 0x01000000
  35. #define DebugLog(_x_) KDCDebugPrint _x_
  36. #define WSZ_DEBUGLEVEL L"DebugLevel"
  37. void GetDebugParams();
  38. void KerbWatchKerbParamKey(PVOID, BOOLEAN);
  39. void KerbGetKerbRegParams(HKEY);
  40. void WaitKerbCleanup(HANDLE);
  41. VOID
  42. FillExtendedError(
  43. IN NTSTATUS NtStatus,
  44. IN ULONG Flags,
  45. IN ULONG FileNum,
  46. IN ULONG LineNum,
  47. OUT PKERB_EXT_ERROR ExtendedError
  48. );
  49. #define KerbPrintKdcName(Level, Name) KerbPrintKdcNameEx(KDCInfoLevel, (Level), (Name))
  50. //
  51. // Extended Error support macros, etc.
  52. //
  53. #define DEB_USE_EXT_ERROR 0x10000000 // Add this to DebugLevel
  54. #define EXT_ERROR_ON(s) (s & DEB_USE_EXT_ERROR)
  55. #define FILL_EXT_ERROR(pStruct, s, f, l) { if (EXT_ERROR_ON(KDCInfoLevel)) \
  56. { pStruct->status = s; pStruct->klininfo = KLIN(f, l); pStruct->flags = EXT_ERROR_CODING_ASN; }}
  57. #define FILL_EXT_ERROR_EX(extendederror, status, filenum, linenum) \
  58. FillExtendedError(status, EXT_ERROR_CLIENT_INFO, filenum, linenum, extendederror)
  59. #define FILL_EXT_ERROR_EX2(extendederror, status, filenum, linenum) \
  60. FillExtendedError(status, EXT_ERROR_CLIENT_INFO | EXT_ERROR_CODING_ASN, filenum, linenum, extendederror)
  61. #else // no RETAIL_LOG_SUPPORT
  62. #define DebugLog(_x_)
  63. #define GetDebugParams()
  64. #define DebugStmt(_x_)
  65. #define KerbWatchKerbParamKey(_x_)
  66. #define KerbPrintKdcName(Level, Name)
  67. #define KerbGetKerbRegParams(_x_)
  68. #define WaitKerbCleanup(_x_)
  69. #define EXT_ERROR_ON(s) FALSE
  70. //#define FillExtError(_x_)
  71. #define FILL_EXT_ERROR(_X_)
  72. #define FILL_EXTENDED_ERROR(extendederror, ntstatus, flags, filenum, linenum)
  73. #define FILL_EXT_ERROR_EX(extendederror, ntstatus, filenum, linenum)
  74. #define FILL_EXT_ERROR_EX2(extendederror, ntstatus, filenum, linenum)
  75. #define KDCInfoLevel
  76. #endif
  77. #if DBG
  78. //
  79. // Functions that only exist in the debug build.
  80. //
  81. void ShowKerbKeyData(PBYTE pData);
  82. void PrintIntervalTime ( ULONG DebugFlag, LPSTR Message, PLARGE_INTEGER Interval );
  83. void PrintTime ( ULONG DebugFlag, LPSTR Message, PLARGE_INTEGER Time );
  84. #define DebugStmt(_x_) _x_
  85. #define D_DebugLog(_x_) DebugLog(_x_) // some debug logs aren't needed in retail builds
  86. #define D_KerbPrintKdcName(_x_) KerbPrintKdcName _x_
  87. #define D_KerbPrintGuid( level, tag, pg ) \
  88. pg == NULL ? DebugLog(( level, "%s: (NULL)\n", tag)) : \
  89. DebugLog((level, \
  90. "%s: %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x\n", \
  91. tag,(pg)->Data1,(pg)->Data2,(pg)->Data3,(pg)->Data4[0], \
  92. (pg)->Data4[1],(pg)->Data4[2],(pg)->Data4[3],(pg)->Data4[4],\
  93. (pg)->Data4[5],(pg)->Data4[6],(pg)->Data4[7]))
  94. DECLARE_HEAP_DEBUG(KDC);
  95. #else
  96. #define ShowKerbKeyData(_x_)
  97. #define PrintIntervalTime(flag, message, interval)
  98. #define PrintTime(flag, message, time)
  99. #define D_KerbPrintGuid(level, tag, pg)
  100. #define D_DebugLog(_x_)
  101. #define D_KerbPrintKdcName(_x_)
  102. #endif // dbg
  103. #endif // __DEBUG_HXX__