Source code of Windows XP (NT5)
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.

82 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name:
  4. trace.h
  5. Abstract:
  6. This module contains definitions of the trace functions
  7. Author:
  8. Michael Tsang (MikeTs) 24-Sep-1998
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #ifndef _TRACE_H
  14. #define _TRACE_H
  15. //
  16. // Constants
  17. //
  18. #define TF_CHECKING_TRACE 0x00000001
  19. //
  20. // Macros
  21. //
  22. #ifdef TRACING
  23. #ifndef PROCNAME
  24. #define PROCNAME(s) static PSZ ProcName = s;
  25. #endif
  26. #define ENTER(n,p) { \
  27. if (IsTraceOn(n, ProcName)) \
  28. { \
  29. gdwfTrace |= TF_CHECKING_TRACE; \
  30. DbgPrint p; \
  31. gdwfTrace &= ~TF_CHECKING_TRACE; \
  32. } \
  33. ++giTraceIndent; \
  34. }
  35. #define EXIT(n,p) { \
  36. --giTraceIndent; \
  37. if (IsTraceOn(n, ProcName)) \
  38. { \
  39. gdwfTrace |= TF_CHECKING_TRACE; \
  40. DbgPrint p; \
  41. gdwfTrace &= ~TF_CHECKING_TRACE; \
  42. } \
  43. }
  44. #else
  45. #define PROCNAME(s)
  46. #define ENTER(n,p)
  47. #define EXIT(n,p)
  48. #endif
  49. //
  50. // Exported function prototypes
  51. //
  52. #ifdef TRACING
  53. //
  54. // Exported data
  55. //
  56. extern int giTraceIndent;
  57. extern ULONG gdwfTrace;
  58. BOOLEAN
  59. IsTraceOn(
  60. IN UCHAR n,
  61. IN PSZ ProcName
  62. );
  63. #endif
  64. #endif //ifndef _TRACE_H