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.

156 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1987-1993 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. NtLmSsp service debug support
  7. Author:
  8. Ported from Lan Man 2.0
  9. Revision History:
  10. 21-May-1991 (cliffv)
  11. Ported to NT. Converted to NT style.
  12. 09-Apr-1992 JohnRo
  13. Prepare for WCHAR.H (_wcsicmp vs _wcscmpi, etc).
  14. 03-Aug-1996 ChandanS
  15. Stolen from net\svcdlls\ntlmssp\debug.h
  16. --*/
  17. //
  18. // init.c will #include this file with DEBUG_ALLOCATE defined.
  19. // That will cause each of these variables to be allocated.
  20. //
  21. #ifdef DEBUG_ALLOCATE
  22. #undef EXTERN
  23. #define EXTERN
  24. #else
  25. #define EXTERN extern
  26. #endif
  27. ////////////////////////////////////////////////////////////////////////
  28. //
  29. // Debug Definititions
  30. //
  31. ////////////////////////////////////////////////////////////////////////
  32. #define SSP_INIT 0x00000001 // Initialization
  33. #define SSP_MISC 0x00000002 // Misc debug
  34. #define SSP_API 0x00000004 // API processing
  35. #define SSP_LPC 0x00000008 // LPC
  36. #define SSP_LOGON_SESS 0x00000010 // tracking logon sessions
  37. #define SSP_CRITICAL 0x00000100 // Only real important errors
  38. #define SSP_LEAK_TRACK 0x00000200 // calling PID etc
  39. #define SSP_WARNING 0x00000400 // not fatal warnings of interest to developer
  40. #define SSP_UPDATES 0x00000800 // updates to globals, passwords, etc.
  41. #define SSP_SESSION_KEYS 0x00001000 // keying material
  42. #define SSP_NEGOTIATE_FLAGS 0x00002000 // negotiate flags.
  43. #define SSP_CRED 0x00004000 // tracking credentials
  44. #define SSP_VERSION 0x00008000 // tracking versioning
  45. //
  46. // Very verbose bits
  47. //
  48. #define SSP_NTLM_V2 0x01000000 // verbose NTLMv2 info
  49. #define SSP_API_MORE 0x04000000 // verbose API
  50. #define SSP_LPC_MORE 0x08000000 // verbose LPC
  51. //
  52. // Control bits.
  53. //
  54. #define SSP_NO_LOCAL 0x10000000 // Force client to use OEM character set
  55. #define SSP_TIMESTAMP 0x20000000 // TimeStamp each output line
  56. #define SSP_REQUEST_TARGET 0x40000000 // Force client to ask for target name
  57. #define SSP_USE_OEM 0x80000000 // Force client to use OEM character set
  58. //
  59. // Name and directory of log file
  60. //
  61. #define DEBUG_DIR L"\\debug"
  62. #define DEBUG_FILE L"\\ntlmssp.log"
  63. #define DEBUG_BAK_FILE L"\\ntlmssp.bak"
  64. #if DBG
  65. EXTERN DWORD SspGlobalDbflag;
  66. #define IF_DEBUG(Function) \
  67. if (SspGlobalDbflag & SSP_ ## Function)
  68. #define SspPrint(_x_) SspPrintRoutine _x_
  69. VOID
  70. SspPrintRoutine(
  71. IN DWORD DebugFlag,
  72. IN LPSTR FORMATSTRING, // PRINTF()-STYLE FORMAT STRING.
  73. ... // OTHER ARGUMENTS ARE POSSIBLE.
  74. );
  75. VOID
  76. SspDumpHexData(
  77. IN DWORD DebugFlag,
  78. IN LPDWORD Buffer,
  79. IN DWORD BufferSize
  80. );
  81. VOID
  82. SspDumpSid(
  83. IN DWORD DebugFlag,
  84. IN PSID Sid
  85. );
  86. VOID
  87. SspDumpBuffer(
  88. IN DWORD DebugFlag,
  89. IN PVOID Buffer,
  90. IN DWORD BufferSize
  91. );
  92. VOID
  93. SspOpenDebugFile(
  94. IN BOOL ReopenFlag
  95. );
  96. //
  97. // Debug log file
  98. //
  99. EXTERN HANDLE SspGlobalLogFile;
  100. #define DEFAULT_MAXIMUM_LOGFILE_SIZE 20000000
  101. EXTERN DWORD SspGlobalLogFileMaxSize;
  102. //
  103. // To serialize access to log file.
  104. //
  105. EXTERN CRITICAL_SECTION SspGlobalLogFileCritSect;
  106. EXTERN LPWSTR SspGlobalDebugSharePath;
  107. #else
  108. #define IF_DEBUG(Function) if (FALSE)
  109. // Nondebug version.
  110. #define SspDumpHexData /* no output; ignore arguments */
  111. #define SspDumpBuffer
  112. #define SspDumpSid
  113. #define SspPrint(_x_)
  114. #endif // DBG
  115. #undef EXTERN