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.

86 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. debug.c
  5. Abstract:
  6. This module implements the debugging function for the MUP.
  7. Author:
  8. Manny Weiser (mannyw) 27-Dec-1991
  9. Revision History:
  10. --*/
  11. #include "mup.h"
  12. #include "stdio.h"
  13. #ifdef MUPDBG
  14. #ifdef ALLOC_PRAGMA
  15. #pragma alloc_text( PAGE, _DebugTrace )
  16. #endif
  17. VOID
  18. _DebugTrace(
  19. LONG Indent,
  20. ULONG Level,
  21. PSZ X,
  22. ULONG Y
  23. )
  24. /*++
  25. Routine Description:
  26. This routine display debugging information.
  27. Arguments:
  28. Level - The debug level required to display this message. If
  29. level is 0 the message is displayed regardless of the setting
  30. or the debug level
  31. Indent - Incremement or the current debug message indent
  32. X - 1st print parameter
  33. Y - 2nd print parameter
  34. Return Value:
  35. None.
  36. --*/
  37. {
  38. LONG i;
  39. char printMask[100];
  40. PAGED_CODE();
  41. if ((Level == 0) || (MupDebugTraceLevel & Level)) {
  42. if (Indent < 0) {
  43. MupDebugTraceIndent += Indent;
  44. }
  45. if (MupDebugTraceIndent < 0) {
  46. MupDebugTraceIndent = 0;
  47. }
  48. sprintf( printMask, "%%08lx:%%.*s%s", X );
  49. i = (LONG)PsGetCurrentThread();
  50. DbgPrint( printMask, i, MupDebugTraceIndent, "", Y );
  51. if (Indent > 0) {
  52. MupDebugTraceIndent += Indent;
  53. }
  54. }
  55. }
  56. #endif // MUPDBG