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.

97 lines
3.3 KiB

  1. /*-----------------------------------------------------------------------------
  2. * Copyright (C) Microsoft Corporation, 1995 - 1996.
  3. * All rights reserved.
  4. *
  5. * This file is part of the Microsoft Private Communication Technology
  6. * reference implementation, version 1.0
  7. *
  8. * The Private Communication Technology reference implementation, version 1.0
  9. * ("PCTRef"), is being provided by Microsoft to encourage the development and
  10. * enhancement of an open standard for secure general-purpose business and
  11. * personal communications on open networks. Microsoft is distributing PCTRef
  12. * at no charge irrespective of whether you use PCTRef for non-commercial or
  13. * commercial use.
  14. *
  15. * Microsoft expressly disclaims any warranty for PCTRef and all derivatives of
  16. * it. PCTRef and any related documentation is provided "as is" without
  17. * warranty of any kind, either express or implied, including, without
  18. * limitation, the implied warranties or merchantability, fitness for a
  19. * particular purpose, or noninfringement. Microsoft shall have no obligation
  20. * to provide maintenance, support, upgrades or new releases to you or to anyone
  21. * receiving from you PCTRef or your modifications. The entire risk arising out
  22. * of use or performance of PCTRef remains with you.
  23. *
  24. * Please see the file LICENSE.txt,
  25. * or http://pct.microsoft.com/pct/pctlicen.txt
  26. * for more information on licensing.
  27. *
  28. * Please see http://pct.microsoft.com/pct/pct.htm for The Private
  29. * Communication Technology Specification version 1.0 ("PCT Specification")
  30. *
  31. * 1/23/96
  32. *----------------------------------------------------------------------------*/
  33. #ifndef __DEBUG_H__
  34. #define __DEBUG_H__
  35. extern DWORD g_dwEventLogging;
  36. #if DBG
  37. extern DWORD PctInfoLevel;
  38. extern DWORD PctTraceIndent;
  39. extern DWORD g_dwInfoLevel;
  40. extern DWORD g_dwDebugBreak;
  41. extern HANDLE g_hfLogFile;
  42. #define DEB_ERROR SP_LOG_ERROR
  43. #define DEB_WARN SP_LOG_WARNING
  44. #define DEB_TRACE SP_LOG_TRACE
  45. #define DEB_BUFFERS SP_LOG_BUFFERS
  46. #define DebugLog(x) SPDebugLog x
  47. #define SP_BEGIN(x) SPDebugLog(DEB_TRACE,"BEGIN:" x "\n"); PctTraceIndent++;
  48. #define SP_RETURN(x) { PctTraceIndent--; SPDebugLog(DEB_TRACE, "END Line %d\n", __LINE__); return (x); }
  49. #define SP_LOG_RESULT(x) SPLogErrorCode((x), __FILE__, __LINE__)
  50. #define SP_END() { PctTraceIndent--; SPDebugLog(DEB_TRACE, "END:Line %d\n", __LINE__); }
  51. #define SP_BREAK() { SPDebugLog(DEB_TRACE, "BREAK Line %d\n", __LINE__); }
  52. #define LogDistinguishedName(a,b,c,d) SPLogDistinguishedName(a,b,c,d)
  53. long SPLogErrorCode(long, const char *, long);
  54. void SPDebugLog(long, const char *, ...);
  55. void
  56. InitDebugSupport(
  57. HKEY hGlobalKey);
  58. void DbgDumpHexString(const unsigned char*, DWORD);
  59. #define DBG_HEX_STRING(l,p,c) if(g_dwInfoLevel & (l)) DbgDumpHexString((p), (c))
  60. #define LOG_RESULT(x) SPLogErrorCode((x), __FILE__, __LINE__)
  61. void
  62. SPLogDistinguishedName(
  63. DWORD LogLevel,
  64. LPSTR pszLabel,
  65. PBYTE pbName,
  66. DWORD cbName);
  67. #else
  68. #define DebugLog(x)
  69. #define SP_BEGIN(x)
  70. #define SP_RETURN(x) return (x)
  71. #define SP_LOG_RESULT(x) x
  72. #define SP_END()
  73. #define SP_BREAK()
  74. #define LOG_RESULT(x)
  75. #define LogDistinguishedName(a,b,c,d)
  76. #endif
  77. #endif /* __DEBUG_H__ */