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.

105 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. msgdbg.h
  5. Abstract:
  6. Contains definitions used in debugging the messenger service.
  7. Author:
  8. Dan Lafferty (danl) 08-Jul-1991
  9. Environment:
  10. User Mode -Win32
  11. Revision History:
  12. 14-Jan-1993 Danl
  13. Created MSG_LOG functions for various number of arguments (up to 3).
  14. --*/
  15. #ifndef _MSGDBG_INCLUDED
  16. #define _MSGDBG_INCLUDED
  17. //
  18. // Information levels used in switch statements.
  19. //
  20. #define LEVEL_0 0L
  21. #define LEVEL_1 1L
  22. #define LEVEL_2 2L
  23. //
  24. // Debug macros and constants.
  25. //
  26. extern DWORD MsgsvcDebugLevel;
  27. //
  28. // The following allow debug print syntax to look like:
  29. //
  30. // SC_LOG(DEBUG_TRACE, "An error occured %x\n",status)
  31. //
  32. #if DBG
  33. #define MSG_LOG0(level,string) \
  34. if( MsgsvcDebugLevel & (DEBUG_ ## level)){ \
  35. DbgPrint("[MSGR]"); \
  36. DbgPrint(string); \
  37. }
  38. #define MSG_LOG1(level,string,var) \
  39. if( MsgsvcDebugLevel & (DEBUG_ ## level)){ \
  40. DbgPrint("[MSGR]"); \
  41. DbgPrint(string,var); \
  42. }
  43. #define MSG_LOG2(level,string,var1,var2) \
  44. if( MsgsvcDebugLevel & (DEBUG_ ## level)){ \
  45. DbgPrint("[MSGR]"); \
  46. DbgPrint(string,var1,var2); \
  47. }
  48. #define MSG_LOG3(level,string,var1,var2,var3) \
  49. if( MsgsvcDebugLevel & (DEBUG_ ## level)){ \
  50. DbgPrint("[MSGR]"); \
  51. DbgPrint(string,var1,var2,var3); \
  52. }
  53. #define MSG_LOG(level,string,var) \
  54. if( MsgsvcDebugLevel & (DEBUG_ ## level)){ \
  55. DbgPrint("[MSGR]"); \
  56. DbgPrint(string,var); \
  57. }
  58. #define STATIC
  59. #else //DBG
  60. #define MSG_LOG0(level,string)
  61. #define MSG_LOG1(level,string,var)
  62. #define MSG_LOG2(level,string,var1,var2)
  63. #define MSG_LOG3(level,string,var1,var2,var3)
  64. #define MSG_LOG(level,string,var)
  65. #define STATIC static
  66. #endif //DBG
  67. #define DEBUG_NONE 0x00000000
  68. #define DEBUG_ERROR 0x00000001
  69. #define DEBUG_TRACE 0x00000002
  70. #define DEBUG_LOCKS 0x00000004
  71. #define DEBUG_GROUP 0x00000008
  72. #define DEBUG_REINIT 0x00000010
  73. #define DEBUG_ALL 0xffffffff
  74. #endif // _MSGDBG_INCLUDED