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.

74 lines
2.6 KiB

  1. /* (C) 1997 Microsoft Corp.
  2. *
  3. * file : Debug.h
  4. * author : Erik Mavrinac
  5. *
  6. * description: MCS debugging defines and prototypes. Requires that
  7. * a stack PSDCONTEXT be available anywhere these calls are made.
  8. */
  9. #if DBG
  10. // These ...Out() macros are graded by the number of extra parameters:
  11. // Out() is only a string, Out1() is one stack parameter, etc.
  12. // We use non-ICA-defined trace types here to allow clean separation from
  13. // WDTShare tracing, which uses the ICA TT_API*, TT_OUT*, TT_IN* macros.
  14. #define MCS_TT_Error TT_ERROR
  15. #define MCS_TT_Warning 0x02000000
  16. #define MCS_TT_Trace 0x04000000
  17. #define MCS_TT_Dump 0x08000000
  18. #define ErrOut(context, str) \
  19. IcaStackTrace(context, TC_PD, MCS_TT_Error, "MCS: **** ERROR: " str "\n")
  20. #define ErrOut1(context, str, arg1) \
  21. IcaStackTrace(context, TC_PD, MCS_TT_Error, "MCS: **** ERROR: " str "\n", arg1)
  22. #define ErrOut2(context, str, arg1, arg2) \
  23. IcaStackTrace(context, TC_PD, MCS_TT_Error, "MCS: **** ERROR: " str "\n", arg1, arg2)
  24. #define WarnOut(context, str) \
  25. IcaStackTrace(context, TC_PD, MCS_TT_Warning, "MCS: warning: " str "\n")
  26. #define WarnOut1(context, str, arg1) \
  27. IcaStackTrace(context, TC_PD, MCS_TT_Warning, "MCS: warning: " str "\n", arg1)
  28. #define WarnOut2(context, str, arg1, arg2) \
  29. IcaStackTrace(context, TC_PD, MCS_TT_Warning, "MCS: warning: " str "\n", arg1, arg2)
  30. #define TraceOut(context, str) \
  31. IcaStackTrace(context, TC_PD, MCS_TT_Trace, "MCS: " str "\n")
  32. #define TraceOut1(context, str, arg1) \
  33. IcaStackTrace(context, TC_PD, MCS_TT_Trace, "MCS: " str "\n", arg1)
  34. #define TraceOut2(context, str, arg1, arg2) \
  35. IcaStackTrace(context, TC_PD, MCS_TT_Trace, "MCS: " str "\n", arg1, arg2)
  36. #define TraceOut3(context, str, arg1, arg2, arg3) \
  37. IcaStackTrace(context, TC_PD, MCS_TT_Trace, "MCS: " str "\n", arg1, arg2, arg3)
  38. #define DumpOut(context, str, buf, len) \
  39. { \
  40. IcaStackTrace(context, TC_PD, MCS_TT_Dump, "MCS: dump: " str "\n"); \
  41. IcaStackTraceBuffer(context, TC_PD, MCS_TT_Dump, buf, len); \
  42. }
  43. #else // DBG
  44. #define ErrOut(context, str)
  45. #define ErrOut1(context, str, arg1)
  46. #define ErrOut2(context, str, arg1, arg2)
  47. #define WarnOut(context, str)
  48. #define WarnOut1(context, str, arg1)
  49. #define WarnOut2(context, str, arg1, arg2)
  50. #define TraceOut(context, str)
  51. #define TraceOut1(context, str, arg1)
  52. #define TraceOut2(context, str, arg1, arg2)
  53. #define TraceOut3(context, str, arg1, arg2, arg3)
  54. #define DumpOut(context, str, buf, len)
  55. #endif // DBG