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.

144 lines
5.3 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ppdebug.h
  5. Abstract:
  6. This header defines debug macros for the Plug and Play subsystem.
  7. Author:
  8. Adrian J. Oney (AdriaO) Sept 14, 2000.
  9. Revision History:
  10. --*/
  11. //#define DBG_SCOPE 1 // Enable SOME DBG stuff on ALL builds
  12. #define DBG_SCOPE DBG // Enable only on DBG build
  13. /*++
  14. Debug output is filtered at two levels: A global level and a component
  15. specific level.
  16. Each debug output request specifies a component id and a filter level
  17. or mask. These variables are used to access the debug print filter
  18. database maintained by the system. The component id selects a 32-bit
  19. mask value and the level either specified a bit within that mask or is
  20. as mask value itself.
  21. If any of the bits specified by the level or mask are set in either the
  22. component mask or the global mask, then the debug output is permitted.
  23. Otherwise, the debug output is filtered and not printed.
  24. The component mask for filtering the debug output of this component is
  25. Kd_NTOSPNP_Mask and may be set via the registry or the kernel debugger.
  26. The global mask for filtering the debug output of all components is
  27. Kd_WIN2000_Mask and may be set via the registry or the kernel debugger.
  28. The registry key for setting the mask value for this component is:
  29. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\
  30. Debug Print Filter\NTOSPNP
  31. The key "Debug Print Filter" may have to be created in order to create
  32. the component key.
  33. Pnp is divided into the following sub-components for debug spew.
  34. 1. LOADUNLOAD: AddDevice, UnloadDriver etc
  35. 2. RESOURCE: Allocation, rebalance etc
  36. 3. ENUMERATION: Starts, enumerations etc
  37. 4. IOAPI: IO APIs etc
  38. 5. IOEVENT: IO events etc
  39. 6. MAPPER: Firmware mapper etc
  40. 7. PNPBIOS: PnP BIOS etc
  41. Each sub-component gets 5 debug levels. The error level for each component
  42. maps to the default error level.
  43. --*/
  44. #define IOP_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  45. #define IOP_WARNING_LEVEL DPFLTR_WARNING_LEVEL
  46. #define IOP_TRACE_LEVEL DPFLTR_TRACE_LEVEL
  47. #define IOP_INFO_LEVEL DPFLTR_INFO_LEVEL
  48. #define IOP_LOADUNLOAD_LEVEL (DPFLTR_INFO_LEVEL + 1)
  49. #define IOP_RESOURCE_LEVEL (DPFLTR_INFO_LEVEL + 5)
  50. #define IOP_ENUMERATION_LEVEL (DPFLTR_INFO_LEVEL + 9)
  51. #define IOP_IOAPI_LEVEL (DPFLTR_INFO_LEVEL + 13)
  52. #define IOP_IOEVENT_LEVEL (DPFLTR_INFO_LEVEL + 17)
  53. #define IOP_MAPPER_LEVEL (DPFLTR_INFO_LEVEL + 21)
  54. #define IOP_PNPBIOS_LEVEL (DPFLTR_INFO_LEVEL + 25)
  55. //
  56. // All error levels map to the default error level.
  57. //
  58. #define IOP_LOADUNLOAD_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  59. #define IOP_RESOURCE_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  60. #define IOP_ENUMERATION_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  61. #define IOP_IOAPI_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  62. #define IOP_IOEVENT_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  63. #define IOP_MAPPER_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  64. #define IOP_PNPBIOS_ERROR_LEVEL DPFLTR_ERROR_LEVEL
  65. //
  66. // Component sublevels are based off the component base level.
  67. //
  68. #define IOP_LOADUNLOAD_WARNING_LEVEL (IOP_LOADUNLOAD_LEVEL + 0)
  69. #define IOP_LOADUNLOAD_TRACE_LEVEL (IOP_LOADUNLOAD_LEVEL + 1)
  70. #define IOP_LOADUNLOAD_INFO_LEVEL (IOP_LOADUNLOAD_LEVEL + 2)
  71. #define IOP_LOADUNLOAD_VERBOSE_LEVEL (IOP_LOADUNLOAD_LEVEL + 3)
  72. #define IOP_RESOURCE_WARNING_LEVEL (IOP_RESOURCE_LEVEL + 0)
  73. #define IOP_RESOURCE_TRACE_LEVEL (IOP_RESOURCE_LEVEL + 1)
  74. #define IOP_RESOURCE_INFO_LEVEL (IOP_RESOURCE_LEVEL + 2)
  75. #define IOP_RESOURCE_VERBOSE_LEVEL (IOP_RESOURCE_LEVEL + 3)
  76. #define IOP_ENUMERATION_WARNING_LEVEL (IOP_ENUMERATION_LEVEL + 0)
  77. #define IOP_ENUMERATION_TRACE_LEVEL (IOP_ENUMERATION_LEVEL + 1)
  78. #define IOP_ENUMERATION_INFO_LEVEL (IOP_ENUMERATION_LEVEL + 2)
  79. #define IOP_ENUMERATION_VERBOSE_LEVEL (IOP_ENUMERATION_LEVEL + 3)
  80. #define IOP_IOAPI_WARNING_LEVEL (IOP_IOAPI_LEVEL + 0)
  81. #define IOP_IOAPI_TRACE_LEVEL (IOP_IOAPI_LEVEL + 1)
  82. #define IOP_IOAPI_INFO_LEVEL (IOP_IOAPI_LEVEL + 2)
  83. #define IOP_IOAPI_VERBOSE_LEVEL (IOP_IOAPI_LEVEL + 3)
  84. #define IOP_IOEVENT_WARNING_LEVEL (IOP_IOEVENT_LEVEL + 0)
  85. #define IOP_IOEVENT_TRACE_LEVEL (IOP_IOEVENT_LEVEL + 1)
  86. #define IOP_IOEVENT_INFO_LEVEL (IOP_IOEVENT_LEVEL + 2)
  87. #define IOP_IOEVENT_VERBOSE_LEVEL (IOP_IOEVENT_LEVEL + 3)
  88. #define IOP_MAPPER_WARNING_LEVEL (IOP_MAPPER_LEVEL + 0)
  89. #define IOP_MAPPER_TRACE_LEVEL (IOP_MAPPER_LEVEL + 1)
  90. #define IOP_MAPPER_INFO_LEVEL (IOP_MAPPER_LEVEL + 2)
  91. #define IOP_MAPPER_VERBOSE_LEVEL (IOP_MAPPER_LEVEL + 3)
  92. #define IOP_PNPBIOS_WARNING_LEVEL (IOP_PNPBIOS_LEVEL + 0)
  93. #define IOP_PNPBIOS_TRACE_LEVEL (IOP_PNPBIOS_LEVEL + 1)
  94. #define IOP_PNPBIOS_INFO_LEVEL (IOP_PNPBIOS_LEVEL + 2)
  95. #define IOP_PNPBIOS_VERBOSE_LEVEL (IOP_PNPBIOS_LEVEL + 3)
  96. #if DBG
  97. ULONG
  98. IopDebugPrint (
  99. IN ULONG Level,
  100. IN PCHAR Format,
  101. ...
  102. );
  103. #define IopDbgPrint(m) IopDebugPrint m
  104. #else
  105. #define IopDbgPrint(m)
  106. #endif