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.

125 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. mprdbg.h
  5. Abstract:
  6. Contains definitions used in debugging the messenger service.
  7. Author:
  8. Dan Lafferty (danl) 07-Oct-1991
  9. Environment:
  10. User Mode -Win32
  11. Revision History:
  12. 22-Jul-1992 Danl
  13. Added different debug macros based on the number of parameters.
  14. Make the macros resolve to nothing when DBG is not defined.
  15. 24-May-1999 jschwart
  16. Have debug macros print out process number
  17. --*/
  18. #ifndef _MPRDBG_INCLUDED
  19. #define _MPRDBG_INCLUDED
  20. //
  21. // Information levels used in switch statements.
  22. //
  23. #define LEVEL_0 0L
  24. #define LEVEL_1 1L
  25. #define LEVEL_2 2L
  26. //
  27. // Debug macros and constants.
  28. //
  29. #if DBG
  30. #define DEBUG_STATE 1
  31. #define STATIC
  32. #else
  33. #define DEBUG_STATE 0
  34. #define STATIC static
  35. #endif
  36. extern DWORD MprDebugLevel;
  37. //
  38. // The following allow debug print syntax to look like:
  39. //
  40. // MPR_LOG(TRACE, "An error occured %x\n",status)
  41. //
  42. #if DBG
  43. //
  44. // debugging macros.
  45. //
  46. #define MPR_LOG0(level,string) \
  47. if( MprDebugLevel & (DEBUG_ ## level)){ \
  48. (VOID) DbgPrint("[MPR] %lx: " string, GetCurrentProcessId()); \
  49. }
  50. #define MPR_LOG1(level,string,var) \
  51. if( MprDebugLevel & (DEBUG_ ## level)){ \
  52. (VOID) DbgPrint("[MPR] %lx: " string,GetCurrentProcessId(),var); \
  53. }
  54. #define MPR_LOG2(level,string,var1,var2) \
  55. if( MprDebugLevel & (DEBUG_ ## level)){ \
  56. (VOID) DbgPrint("[MPR] %lx: " string,GetCurrentProcessId(),var1,var2); \
  57. }
  58. #define MPR_LOG3(level,string,var1,var2,var3) \
  59. if( MprDebugLevel & (DEBUG_ ## level)){ \
  60. (VOID) DbgPrint("[MPR] %lx: " string,GetCurrentProcessId(),var1,var2,var3); \
  61. }
  62. #define MPR_LOG(level,string,var) \
  63. if( MprDebugLevel & (DEBUG_ ## level)){ \
  64. (VOID) DbgPrint("[MPR] %lx: " string,GetCurrentProcessId(),var); \
  65. }
  66. #else // DBG
  67. #define MPR_LOG0(level,string)
  68. #define MPR_LOG1(level,string,var)
  69. #define MPR_LOG2(level,string,var1,var2)
  70. #define MPR_LOG3(level,string,var1,var2,var3)
  71. #define MPR_LOG(level,string,var)
  72. #endif // DBG
  73. #define DEBUG_NONE 0x00000000
  74. #define DEBUG_ERROR 0x00000001
  75. #define DEBUG_TRACE 0x00000002 // Miscellaneous trace info
  76. #define DEBUG_LOCKS 0x00000004 // Multi-thread data locks
  77. #define DEBUG_PS 0x00000008 // Thread and Process information
  78. #define DEBUG_RESTORE 0x00000010 // Restore Connection information
  79. #define DEBUG_CNOTIFY 0x00000020 // Connection Notify information
  80. #define DEBUG_ANSI 0x00000040 // Ansi API thunks
  81. #define DEBUG_ROUTE 0x00000080 // Routing of calls among providers
  82. #define DEBUG_ALL 0xffffffff
  83. #endif // _MPRDBG_INCLUDED
  84. //
  85. // Function Prototypes
  86. //
  87. VOID
  88. PrintKeyInfo(
  89. HKEY key);