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.

109 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name :
  4. drdbg.h
  5. Abstract:
  6. User-Mode RDP Network Provider Debugging Module.
  7. Author:
  8. JoyC
  9. Revision History:
  10. --*/
  11. #ifndef _DRDBG_
  12. #define _DRDBG_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. ////////////////////////////////////////////////////////
  17. //
  18. // Debugging
  19. //
  20. #undef ASSERT
  21. // Used to scramble released memory.
  22. #define DBG_GARBAGEMEM 0xCC
  23. // Debug message levels
  24. #define DBG_NONE 0x0000
  25. #define DBG_INFO 0x0001
  26. #define DBG_WARN 0x0002
  27. #define DBG_WARNING 0x0002
  28. #define DBG_ERROR 0x0004
  29. #define DBG_TRACE 0x0008
  30. #define DBG_SECURITY 0x0010
  31. #define DBG_EXEC 0x0020
  32. #define DBG_PORT 0x0040
  33. #define DBG_NOTIFY 0x0080
  34. #define DBG_PAUSE 0x0100
  35. #define DBG_ASSERT 0x0200
  36. #define DBG_THREADM 0x0400
  37. #define DBG_MIN 0x0800
  38. #define DBG_TIME 0x1000
  39. #define DBG_FOLDER 0x2000
  40. #define DBG_NOHEAD 0x8000
  41. #if DBG
  42. ULONG DbgPrint(PCH Format, ...);
  43. VOID DbgBreakPoint(VOID);
  44. /* These flags are not used as arguments to the DBGMSG macro.
  45. * You have to set the high word of the global variable to cause it to break.
  46. * It is ignored if used with DBGMSG.
  47. * (Here mainly for explanatory purposes.)
  48. */
  49. #define DBG_BREAK_ON_WARNING ( DBG_WARNING << 16 )
  50. #define DBG_BREAK_ON_ERROR ( DBG_ERROR << 16 )
  51. /* Double braces are needed for this one, e.g.:
  52. *
  53. * DBGMSG( DBG_ERROR, ( "Error code %d", Error ) );
  54. *
  55. * This is because we can't use variable parameter lists in macros.
  56. * The statement gets pre-processed to a semi-colon in non-debug mode.
  57. *
  58. * Set the global variable GLOBAL_DEBUG_FLAGS via the debugger.
  59. * Setting the flag in the low word causes that level to be printed;
  60. * setting the high word causes a break into the debugger.
  61. * E.g. setting it to 0x00040006 will print out all warning and error
  62. * messages, and break on errors.
  63. */
  64. #define DBGMSG( Level, MsgAndArgs ) \
  65. { \
  66. if( ( Level & 0xFFFF ) & GLOBAL_DEBUG_FLAGS ) \
  67. DbgPrint MsgAndArgs; \
  68. if( ( Level << 16 ) & GLOBAL_DEBUG_FLAGS ) \
  69. DbgBreakPoint(); \
  70. }
  71. #define ASSERT(expr) \
  72. if (!(expr)) { \
  73. DbgPrint( "Failed: %s\nLine %d, %s\n", \
  74. #expr, \
  75. __LINE__, \
  76. __FILE__ ); \
  77. DebugBreak(); \
  78. }
  79. #else
  80. #define DBGMSG
  81. #define ASSERT(exp)
  82. #endif
  83. #ifdef __cplusplus
  84. }
  85. #endif // __cplusplus
  86. #endif // #ifndef _DRDBG_