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.

86 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. This module defines debug functions and manifests.
  7. Author:
  8. Manny Weiser (mannyw) 20-Dec-1991
  9. Revision History:
  10. --*/
  11. #ifndef _MUPDEBUG_
  12. #define _MUPDEBUG_
  13. //
  14. // MUP debug level
  15. //
  16. #ifdef MUPDBG
  17. #define DEBUG_TRACE_FILOBSUP 0x00000001
  18. #define DEBUG_TRACE_CREATE 0x00000002
  19. #define DEBUG_TRACE_FSCONTROL 0x00000004
  20. #define DEBUG_TRACE_REFCOUNT 0x00000008
  21. #define DEBUG_TRACE_CLOSE 0x00000010
  22. #define DEBUG_TRACE_CLEANUP 0x00000020
  23. #define DEBUG_TRACE_FORWARD 0x00000040
  24. #define DEBUG_TRACE_BLOCK 0x00000080
  25. extern LONG MsDebugTraceLevel;
  26. extern LONG MsDebugTraceIndent;
  27. VOID
  28. _DebugTrace(
  29. LONG Indent,
  30. ULONG Level,
  31. PSZ X,
  32. ULONG Y
  33. );
  34. #define DebugDump(STR,LEVEL,PTR) { \
  35. ULONG _i; \
  36. VOID MupDump(); \
  37. if (((LEVEL) == 0) || (MupDebugTraceLevel & (LEVEL))) { \
  38. _i = (ULONG)PsGetCurrentThread(); \
  39. DbgPrint("%08lx:",_i); \
  40. DbgPrint(STR); \
  41. if (PTR != NULL) {MupDump(PTR);} \
  42. DbgBreakPoint(); \
  43. } \
  44. }
  45. #define DebugTrace(i,l,x,y) _DebugTrace(i,l,x,(ULONG)y)
  46. //
  47. // The following routine and macro is used to catch exceptions in
  48. // try except statements. It allows us to catch the exception before
  49. // executing the exception handler. The exception catcher procedure is
  50. // declared in msdata.c
  51. //
  52. LONG MupExceptionCatcher (IN PSZ String);
  53. #define Exception(STR) (MupExceptionCatcher(STR))
  54. #else // MUPDBG
  55. #define DebugDump(STR,LEVEL,PTR) {NOTHING;}
  56. #define Exception(STR) (EXCEPTION_EXECUTE_HANDLER)
  57. #define DebugTrace(I,L,X,Y) {NOTHING;}
  58. #endif // MUPDBG
  59. #endif // _MUPDBG_