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.

83 lines
2.1 KiB

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