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.

78 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name:
  4. trtrace.c
  5. Abstract:
  6. This module contains the code for debug tracing.
  7. Author:
  8. Michael Tsang (MikeTs) 24-Sep-1998
  9. Environment:
  10. User mode
  11. Revision History:
  12. --*/
  13. #include "pch.h"
  14. #ifdef TRTRACE
  15. //
  16. // Local Data
  17. //
  18. int giTRTraceLevel = 0;
  19. int giTRTraceIndent = 0;
  20. ULONG gdwfTRTrace = 0;
  21. /*++
  22. Routine Description:
  23. This routine determines if the given procedure should be traced.
  24. Arguments:
  25. n - trace level of the procedure
  26. ProcName - points to the procedure name string
  27. Return Value:
  28. Success - returns TRUE
  29. Failure - returns FALSE
  30. --*/
  31. BOOLEAN
  32. TRIsTraceOn(
  33. IN int n,
  34. IN PSZ ProcName
  35. )
  36. {
  37. BOOLEAN rc = FALSE;
  38. if (!(gdwfTRTrace & TF_CHECKING_TRACE) && (giTRTraceLevel >= n))
  39. {
  40. int i;
  41. TRDebugPrint(MODNAME ": ");
  42. for (i = 0; i < giTRTraceIndent; ++i)
  43. {
  44. TRDebugPrint("| ");
  45. }
  46. TRDebugPrint(ProcName);
  47. rc = TRUE;
  48. }
  49. return rc;
  50. } //TRIsTraceOn
  51. #endif //ifdef TRTRACE