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.

105 lines
3.4 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: ssdebug.h
  3. *
  4. * Debugging stuff
  5. *
  6. * Copyright (c) 1996 Microsoft Corporation
  7. *
  8. \**************************************************************************/
  9. #ifndef __ssdebug_h__
  10. #define __ssdebug_h__
  11. ULONG DbgPrint(PCH Format, ...);
  12. #define SS_LEVEL_ERROR 1L
  13. #define SS_LEVEL_INFO 2L
  14. #define SS_LEVEL_ENTRY 8L
  15. #if DBG
  16. extern long ssDebugMsg;
  17. extern long ssDebugLevel;
  18. #define SS_DBGPRINT( str ) DbgPrint("SS: " str )
  19. #define SS_DBGPRINT1( str, a ) DbgPrint("SS: " str, a )
  20. #define SS_DBGPRINT2( str, a, b ) DbgPrint("SS: " str, a, b )
  21. #define SS_DBGPRINT3( str, a, b, c ) DbgPrint("SS: " str, a, b, c )
  22. #define SS_DBGPRINT4( str, a, b, c, d ) DbgPrint("SS: " str, a, b, c, d )
  23. #define SS_WARNING(str) DbgPrint("SS: " str )
  24. #define SS_WARNING1(str,a) DbgPrint("SS: " str,a)
  25. #define SS_WARNING2(str,a,b) DbgPrint("SS: " str,a,b)
  26. #define SS_RIP(str) {SS_WARNING(str); DebugBreak();}
  27. #define SS_RIP1(str,a) {SS_WARNING1(str,a); DebugBreak();}
  28. #define SS_RIP2(str,a,b) {SS_WARNING2(str,a,b); DebugBreak();}
  29. #define SS_ASSERT(expr,str) if(!(expr)) SS_RIP(str)
  30. #define SS_ASSERT1(expr,str,a) if(!(expr)) SS_RIP1(str,a)
  31. #define SS_ASSERT2(expr,str,a,b) if(!(expr)) SS_RIP2(str,a,b)
  32. #define SS_ALLOC_FAILURE(str) \
  33. DbgPrint( "%s : Memory allocation failure\n", str );
  34. #define SS_DBGMSG( str ) if( ssDebugMsg ) SS_DBGPRINT( str )
  35. #define SS_DBGMSG1( str, a ) if( ssDebugMsg ) SS_DBGPRINT1( str, a )
  36. #define SS_DBGMSG2( str, a, b ) if( ssDebugMsg ) SS_DBGPRINT2( str, a, b )
  37. //
  38. // Use SS_DBGLEVEL for general purpose debug messages gated by an
  39. // arbitrary warning level.
  40. //
  41. #define SS_DBGLEVEL(n,str) if (ssDebugLevel >= (n)) SS_DBGPRINT(str)
  42. #define SS_DBGLEVEL1(n,str,a) if (ssDebugLevel >= (n)) SS_DBGPRINT1(str,a)
  43. #define SS_DBGLEVEL2(n,str,a,b) if (ssDebugLevel >= (n)) SS_DBGPRINT2(str,a,b)
  44. #define SS_ERROR(str) SS_DBGLEVEL( SS_LEVEL_ERROR, str )
  45. #define SS_ERROR1(str,a) SS_DBGLEVEL1( SS_LEVEL_ERROR, str, a )
  46. #define SS_ERROR2(str,a) SS_DBGLEVEL2( SS_LEVEL_ERROR, str, a, b )
  47. #define SS_DBGINFO(str) SS_DBGLEVEL( SS_LEVEL_INFO, str )
  48. #define SS_DBGINFO1(str,a) SS_DBGLEVEL1( SS_LEVEL_INFO, str, a )
  49. #define SS_DBGINFO2(str,a,b) SS_DBGLEVEL2( SS_LEVEL_INFO, str, a, b )
  50. #else
  51. #define SS_DBGPRINT( str )
  52. #define SS_DBGPRINT1( str, a )
  53. #define SS_DBGPRINT2( str, a, b )
  54. #define SS_DBGPRINT3( str, a, b, c )
  55. #define SS_DBGPRINT4( str, a, b, c, d )
  56. #define SS_WARNING(str)
  57. #define SS_WARNING1(str,a)
  58. #define SS_WARNING2(str,a,b)
  59. #define SS_RIP(str)
  60. #define SS_RIP1(str,a)
  61. #define SS_RIP2(str,a,b)
  62. #define SS_ASSERT(expr,str) assert( expr )
  63. #define SS_ASSERT1(expr,str,a) assert( expr )
  64. #define SS_ASSERT2(expr,str,a,b) assert( expr )
  65. #define SS_ALLOC_FAILURE(str)
  66. #define SS_DBGMSG( str )
  67. #define SS_DBGMSG1( str, a )
  68. #define SS_DBGMSG2( str, a, b )
  69. #define SS_DBGLEVEL(n,str)
  70. #define SS_DBGLEVEL1(n,str,a)
  71. #define SS_DBGLEVEL2(n,str,a,b)
  72. #define SS_ERROR(str)
  73. #define SS_ERROR1(str,a)
  74. #define SS_ERROR2(str,a,b)
  75. #define SS_DBGINFO(str)
  76. #define SS_DBGINFO1(str,a)
  77. #define SS_DBGINFO2(str,a,b)
  78. #endif // DBG
  79. #endif // __ssdebug_h__