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. wttrace.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 WTTRACE
  15. //
  16. // Local Data
  17. //
  18. int giWTTraceLevel = 0;
  19. int giWTTraceIndent = 0;
  20. ULONG gdwfWTTrace = 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 LOCAL
  32. WTIsTraceOn(
  33. IN int n,
  34. IN PSZ ProcName
  35. )
  36. {
  37. BOOLEAN rc = FALSE;
  38. if (!(gdwfWTTrace & TF_CHECKING_TRACE) && (n <= giWTTraceLevel))
  39. {
  40. int i;
  41. WTDebugPrint(MODNAME ": ");
  42. for (i = 0; i < giWTTraceIndent; ++i)
  43. {
  44. WTDebugPrint("| ");
  45. }
  46. WTDebugPrint(ProcName);
  47. rc = TRUE;
  48. }
  49. return rc;
  50. } //WTIsTraceOn
  51. #endif //ifdef WTTRACE