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.

123 lines
3.7 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_SOCK 0x00001000
  25. #define DEB_T_TRANSIT 0x00000100
  26. #define DEB_T_PERF_STATS 0x00000200
  27. #define DEB_T_PKI 0x00000400
  28. #define DEB_FUNCTION 0x00010000 // function level tracing
  29. #define DebugLog(_x_) KDCDebugPrint _x_
  30. #define WSZ_DEBUGLEVEL L"DebugLevel"
  31. void GetDebugParams();
  32. void KerbWatchParamKey(PVOID, BOOLEAN);
  33. void KerbGetKDCRegParams(HKEY);
  34. void WaitCleanup(HANDLE);
  35. #define KerbPrintKdcName(Level,Name) KerbPrintKdcNameEx(KDCInfoLevel, (Level),(Name))
  36. //
  37. // Extended Error support macros, etc.
  38. //
  39. #define EXT_ERROR_ON(s) (s & DEB_USE_EXT_ERROR)
  40. #define FILL_EXT_ERROR(pStruct, s, f, l) {if (EXT_ERROR_ON(KDCInfoLevel))\
  41. {pStruct->status=s;pStruct->klininfo=KLIN(f,l);pStruct->flags=0;}}
  42. #define FILL_EXT_ERROR_EX(pStruct,s,f,l) {if (EXT_ERROR_ON(KDCInfoLevel))\
  43. {FILL_EXT_ERROR(pStruct,s,f,l);}else{pStruct->status=s;\
  44. pStruct->klininfo=0;pStruct->flags=EXT_ERROR_CLIENT_INFO;}}
  45. #define DEB_USE_EXT_ERROR 0x10000000 // Add this to DebugLevel
  46. #else // no RETAIL_LOG_SUPPORT
  47. #define DebugLog(_x_)
  48. #define GetDebugParams()
  49. #define DebugStmt(_x_)
  50. #define KerbWatchParamKey(_x_)
  51. #define KerbPrintKdcName(l,n)
  52. #define KerbGetKDCRegParams(_x_)
  53. #define WaitCleanup(_x_)
  54. #define EXT_ERROR_ON(s) FALSE
  55. //#define FillExtError(_x_)
  56. #define FILL_EXT_ERROR(_X_)
  57. #define FILL_EXT_ERROR_EX(_X_)
  58. #define KDCInfoLevel
  59. #endif
  60. #if DBG
  61. //
  62. // Functions that only exist in the debug build.
  63. //
  64. void ShowKerbKeyData(PBYTE pData);
  65. void PrintIntervalTime ( ULONG DebugFlag, LPSTR Message, PLARGE_INTEGER Interval );
  66. void PrintTime ( ULONG DebugFlag, LPSTR Message, PLARGE_INTEGER Time );
  67. #define DebugStmt(_x_) _x_
  68. #define D_DebugLog(_x_) DebugLog(_x_) // some debug logs aren't needed in retail builds
  69. #define D_KerbPrintKdcName(l,n) KerbPrintKdcName(l,n)
  70. #define KerbPrintGuid( level, tag, pg ) \
  71. pg == NULL ? DebugLog(( level, "%s: (NULL)\n", tag)) : \
  72. DebugLog((level, \
  73. "%s: %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x\n", \
  74. tag,(pg)->Data1,(pg)->Data2,(pg)->Data3,(pg)->Data4[0], \
  75. (pg)->Data4[1],(pg)->Data4[2],(pg)->Data4[3],(pg)->Data4[4],\
  76. (pg)->Data4[5],(pg)->Data4[6],(pg)->Data4[7]))
  77. DECLARE_HEAP_DEBUG(KDC);
  78. #else
  79. #define ShowKerbKeyData(_x_)
  80. #define PrintIntervalTime(flag,message,interval)
  81. #define PrintTime(flag,message,time)
  82. #define D_KerbPrintKdcName(l,n)
  83. #define KerbPrintGuid( level, tag, pg )
  84. #define D_DebugLog(_x_)
  85. #endif // dbg
  86. #endif // __DEBUG_HXX__