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.

93 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. dbg.c
  5. Abstract:
  6. Debug functions and services
  7. Environment:
  8. kernel mode only
  9. Notes:
  10. Revision History:
  11. 12/12/2001 : created jsenior
  12. --*/
  13. #include "pch.h"
  14. #include "stdarg.h"
  15. #include "stdio.h"
  16. // paged functions
  17. #ifdef ALLOC_PRAGMA
  18. #endif
  19. #if DBG
  20. /******
  21. DEBUG
  22. ******/
  23. #define DEFAULT_DEBUG_LEVEL 2
  24. ULONG HidIrDebug_Trace_Level = DEFAULT_DEBUG_LEVEL;
  25. ULONG
  26. _cdecl
  27. HidIrKdPrintX(
  28. ULONG l,
  29. PCH Format,
  30. ...
  31. )
  32. /*++
  33. Routine Description:
  34. Debug Print function.
  35. Prints based on the value of the HidIrDEBUG_TRACE_LEVEL
  36. Also if HidIrW98_Debug_Trace is set then all debug messages
  37. with a level greater than one are modified to go in to the
  38. ntkern trace buffer.
  39. It is only valid to set HidIrW98_Debug_Trace on Win9x
  40. becuse the static data segments for drivers are marked read-only
  41. by the NT OS.
  42. Arguments:
  43. Return Value:
  44. --*/
  45. {
  46. va_list list;
  47. int i;
  48. int arg[6];
  49. if (HidIrDebug_Trace_Level >= l) {
  50. // dump line to debugger
  51. DbgPrint("'HIDIR.SYS: ");
  52. va_start(list, Format);
  53. for (i=0; i<6; i++)
  54. arg[i] = va_arg(list, int);
  55. DbgPrint(Format, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]);
  56. DbgPrint("\n");
  57. }
  58. return 0;
  59. }
  60. #endif /* DBG */