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
1.0 KiB

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