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.

96 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998-99 Microsoft Corporation
  3. Module Name:
  4. licdbg.h
  5. Abstract:
  6. Author:
  7. Fred Chong (FredCh) 7/1/1998
  8. Environment:
  9. Notes:
  10. --*/
  11. #ifndef __LICDBG_H__
  12. #define __LICDBG_H__
  13. #define LS_LOG_ERROR 0x0001
  14. #define LS_LOG_WARNING 0x0002
  15. #define LS_LOG_TRACE 0x0004
  16. #define LS_LOG_ALLOC 0x0008
  17. #define LS_LOG_RES 0x0010
  18. #define DEB_ERROR LS_LOG_ERROR
  19. #define DEB_WARN LS_LOG_WARNING
  20. #define DEB_TRACE LS_LOG_TRACE
  21. #if DBG
  22. extern DWORD LicenseTraceIndent;
  23. #define LS_ASSERT(x) \
  24. if (!(x)) \
  25. LSAssert(#x, __FILE__, __LINE__, NULL); else
  26. #define DebugLog(x) LicenseDebugLog x
  27. #ifndef OS_WINCE
  28. #define LS_BEGIN(x) LicenseDebugLog(DEB_TRACE,"BEGIN:" x "\n"); LicenseTraceIndent++;
  29. #else
  30. #define LS_BEGIN(x) LicenseDebugLog(DEB_TRACE,"BEGIN:", x, "\n"); LicenseTraceIndent++;
  31. #endif
  32. #define LS_RETURN(x) { LicenseTraceIndent--; LicenseDebugLog(DEB_TRACE, "END Line %d\n", __LINE__); return (x); }
  33. #define LS_LOG_RESULT(x) LicenseLogErrorCode((x), __FILE__, __LINE__)
  34. #define LS_END(x) { LicenseTraceIndent--; LicenseDebugLog(DEB_TRACE, "END:Line %d\n", __LINE__); }
  35. #define LS_BREAK() { LicenseDebugLog(DEB_TRACE, "BREAK Line %d\n", __LINE__); }
  36. #define LS_DUMPSTRING(size, data) \
  37. if ((data)) \
  38. DbgDumpHexString((data), (size));
  39. void
  40. LicenseDebugOutput(char *szOutString);
  41. long
  42. //CALL_TYPE
  43. LicenseLogErrorCode(long, const char *, long);
  44. void
  45. //CALL_TYPE
  46. //_cdecl
  47. LicenseDebugLog(long, const char *, ...);
  48. void
  49. //CALL_TYPE
  50. DbgDumpHexString(const unsigned char*, DWORD);
  51. void
  52. //CALL_TYPE
  53. LSAssert( void *, void *, unsigned long, char *);
  54. #else
  55. #define LS_ASSERT(x)
  56. #define DebugLog(x)
  57. #define LS_BEGIN(x)
  58. #define LS_RETURN(x) return (x)
  59. #define LS_LOG_RESULT(x) x
  60. #define LS_END(x)
  61. #define LS_BREAK()
  62. #define LS_DUMPSTRING(size, data)
  63. #define LicenseDebugOutput(x)
  64. #define LicenseDebugLog
  65. #define DbgDumpHexString(x, y)
  66. #define LicenseTraceIndent
  67. #define LicenseLogErrorCode
  68. #endif //_DEBUG
  69. #endif /* __LICDBG_H__ */