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. wttrace.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 _WTTRACE_H
  14. #define _WTTRACE_H
  15. //
  16. // Constants
  17. //
  18. #define TF_CHECKING_TRACE 0x00000001
  19. //
  20. // Macros
  21. //
  22. #ifdef WTTRACE
  23. #define WTTRACEPROC(s,n) static PSZ ProcName = s; \
  24. static int ProcLevel = n;
  25. #define WTENTER(p) { \
  26. if (WTIsTraceOn(ProcLevel, ProcName)) \
  27. { \
  28. gdwfWTTrace |= TF_CHECKING_TRACE; \
  29. WTDebugPrint p; \
  30. gdwfWTTrace &= ~TF_CHECKING_TRACE; \
  31. } \
  32. ++giWTTraceIndent; \
  33. }
  34. #define WTEXIT(p) { \
  35. --giWTTraceIndent; \
  36. if (WTIsTraceOn(ProcLevel, ProcName)) \
  37. { \
  38. gdwfWTTrace |= TF_CHECKING_TRACE; \
  39. WTDebugPrint p; \
  40. gdwfWTTrace &= ~TF_CHECKING_TRACE; \
  41. } \
  42. }
  43. #else
  44. #define WTTRACEPROC(s,n)
  45. #define WTENTER(p)
  46. #define WTEXIT(p)
  47. #endif
  48. //
  49. // Exported data
  50. //
  51. #ifdef WTTRACE
  52. extern int giWTTraceIndent;
  53. extern ULONG gdwfWTTrace;
  54. #endif
  55. //
  56. // Exported function prototypes
  57. //
  58. #ifdef WTTRACE
  59. BOOLEAN LOCAL
  60. WTIsTraceOn(
  61. IN int n,
  62. IN PSZ ProcName
  63. );
  64. #endif
  65. #endif //ifndef _WTTRACE_H