Leaked source code of windows server 2003
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.

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