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.

246 lines
7.5 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vfmessage.h
  5. Abstract:
  6. This module contains prototypes for functions used to retrieve text and
  7. flags associated with each error.
  8. Author:
  9. Adrian J. Oney (adriao) 20-Apr-1998
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. AdriaO 02/10/2000 - Seperated out from ntos\io\ioassert.c
  14. --*/
  15. //
  16. // The verifier uses tables of messages and with indexes into the tables.
  17. //
  18. typedef ULONG VFMESSAGE_TABLEID;
  19. typedef ULONG VFMESSAGE_ERRORID;
  20. //
  21. // VFM_ flags control how a verifier message is handled.
  22. //
  23. // VFM_FLAG_INITIALIZED - Set when the error template has been updated with
  24. // error-class information
  25. //
  26. // VFM_FLAG_BEEP - Set if error should beep in debugger
  27. //
  28. // VFM_FLAG_ZAPPED - Set if error was "zapped" (ie prints instead of
  29. // stops) via debugger
  30. //
  31. // VFM_FLAG_CLEARED - Set if error was cleared (disabled) in debugger
  32. //
  33. // VFM_DEPLOYMENT_FAILURE - Set if the error is severe enough to warrant
  34. // removal of the driver from a production system
  35. //
  36. // VFM_LOGO_FAILURE - Set if the error should disallow certification
  37. // for the hardware or the driver
  38. //
  39. // VFM_IGNORE_DRIVER_LIST - Set if error should fire regardless of whether
  40. // the offending driver is being verified or not.
  41. //
  42. #define VFM_FLAG_INITIALIZED 0x00000001
  43. #define VFM_FLAG_BEEP 0x00000002
  44. #define VFM_FLAG_ZAPPED 0x00000004
  45. #define VFM_FLAG_CLEARED 0x00000008
  46. #define VFM_DEPLOYMENT_FAILURE 0x00000010
  47. #define VFM_LOGO_FAILURE 0x00000020
  48. #define VFM_IGNORE_DRIVER_LIST 0x00000040
  49. //
  50. // A message class contains VFM_ flags and some generic text describing the
  51. // problem class.
  52. //
  53. typedef struct _VFMESSAGE_CLASS {
  54. ULONG ClassFlags;
  55. PCSTR MessageClassText;
  56. } VFMESSAGE_CLASS, *PVFMESSAGE_CLASS;
  57. typedef VFMESSAGE_CLASS const *PCVFMESSAGE_CLASS;
  58. //
  59. // Individual error template. Identifies the index, the message class it's
  60. // associated with, the parameters it takes along with the formatted text it
  61. // displays. Note the ulong flags field - this should always be preinited to
  62. // zero!
  63. //
  64. typedef struct _VFMESSAGE_TEMPLATE {
  65. VFMESSAGE_ERRORID MessageID;
  66. PCVFMESSAGE_CLASS MessageClass;
  67. ULONG Flags;
  68. PCSTR ParamString;
  69. PCSTR MessageText;
  70. } VFMESSAGE_TEMPLATE, *PVFMESSAGE_TEMPLATE;
  71. //
  72. // Message index 0 is reserved for use in the override tables
  73. //
  74. #define VIMESSAGE_ALL_IDS 0
  75. //
  76. // An override entry allows the verifier to special case generic assertions
  77. // that occur against specific drivers. This is done by overriding the error
  78. // class on the fly.
  79. //
  80. typedef struct _VFMESSAGE_OVERRIDE {
  81. VFMESSAGE_ERRORID MessageID;
  82. PCSTR DriverName;
  83. PCVFMESSAGE_CLASS ReplacementClass;
  84. } VFMESSAGE_OVERRIDE, *PVFMESSAGE_OVERRIDE;
  85. typedef VFMESSAGE_OVERRIDE const *PCVFMESSAGE_OVERRIDE;
  86. //
  87. // The table of errors. Contains the TableID (used for internal lookup),
  88. // bugcheck major ID, array of messages and array of overrides
  89. //
  90. typedef struct _VFMESSAGE_TEMPLATE_TABLE {
  91. VFMESSAGE_TABLEID TableID;
  92. ULONG BugCheckMajor;
  93. PVFMESSAGE_TEMPLATE TemplateArray;
  94. ULONG TemplateCount;
  95. PCVFMESSAGE_OVERRIDE OverrideArray;
  96. ULONG OverrideCount;
  97. } VFMESSAGE_TEMPLATE_TABLE, *PVFMESSAGE_TEMPLATE_TABLE;
  98. //
  99. // Retrieves an internal error table based on ID.
  100. //
  101. VOID
  102. VfMessageRetrieveInternalTable(
  103. IN VFMESSAGE_TABLEID TableID,
  104. OUT PVFMESSAGE_TEMPLATE_TABLE *MessageTable
  105. );
  106. //
  107. // Retrieves and formats the appropriate error message.
  108. //
  109. VOID
  110. VfMessageRetrieveErrorData(
  111. IN PVFMESSAGE_TEMPLATE_TABLE MessageTable OPTIONAL,
  112. IN VFMESSAGE_ERRORID MessageID,
  113. IN PSTR AnsiDriverName,
  114. OUT ULONG *BugCheckMajor,
  115. OUT PCVFMESSAGE_CLASS *MessageClass,
  116. OUT PCSTR *MessageTextTemplate,
  117. OUT PULONG *TemplateFlags
  118. );
  119. //
  120. // This file contains a set of internal message tables.
  121. //
  122. // The IO Verifier Table Index is...
  123. //
  124. #define VFMESSAGE_TABLE_IOVERIFIER 1
  125. //
  126. // IO Verifier Messages
  127. //
  128. typedef enum _DCERROR_ID {
  129. DCERROR_UNSPECIFIED = 0x200,
  130. DCERROR_DELETE_WHILE_ATTACHED,
  131. DCERROR_DETACH_NOT_ATTACHED,
  132. DCERROR_CANCELROUTINE_FORWARDED,
  133. DCERROR_NULL_DEVOBJ_FORWARDED,
  134. DCERROR_QUEUED_IRP_FORWARDED,
  135. DCERROR_NEXTIRPSP_DIRTY,
  136. DCERROR_IRPSP_COPIED,
  137. DCERROR_INSUFFICIENT_STACK_LOCATIONS,
  138. DCERROR_QUEUED_IRP_COMPLETED,
  139. DCERROR_FREE_OF_INUSE_TRACKED_IRP,
  140. DCERROR_FREE_OF_INUSE_IRP,
  141. DCERROR_FREE_OF_THREADED_IRP,
  142. DCERROR_REINIT_OF_ALLOCATED_IRP_WITH_QUOTA,
  143. DCERROR_PNP_IRP_BAD_INITIAL_STATUS,
  144. DCERROR_POWER_IRP_BAD_INITIAL_STATUS,
  145. DCERROR_WMI_IRP_BAD_INITIAL_STATUS,
  146. DCERROR_SKIPPED_DEVICE_OBJECT,
  147. DCERROR_BOGUS_FUNC_TRASHED,
  148. DCERROR_BOGUS_STATUS_TRASHED,
  149. DCERROR_BOGUS_INFO_TRASHED,
  150. DCERROR_PNP_FAILURE_FORWARDED,
  151. DCERROR_PNP_IRP_STATUS_RESET,
  152. DCERROR_PNP_IRP_NEEDS_HANDLING,
  153. DCERROR_PNP_IRP_HANDS_OFF,
  154. DCERROR_POWER_FAILURE_FORWARDED,
  155. DCERROR_POWER_IRP_STATUS_RESET,
  156. DCERROR_INVALID_STATUS,
  157. DCERROR_UNNECCESSARY_COPY,
  158. DCERROR_SHOULDVE_DETACHED,
  159. DCERROR_SHOULDVE_DELETED,
  160. DCERROR_MISSING_DISPATCH_FUNCTION,
  161. DCERROR_WMI_IRP_NOT_FORWARDED,
  162. DCERROR_DELETED_PRESENT_PDO,
  163. DCERROR_BUS_FILTER_ERRONEOUSLY_DETACHED,
  164. DCERROR_BUS_FILTER_ERRONEOUSLY_DELETED,
  165. DCERROR_INCONSISTANT_STATUS,
  166. DCERROR_UNINITIALIZED_STATUS,
  167. DCERROR_IRP_RETURNED_WITHOUT_COMPLETION,
  168. DCERROR_COMPLETION_ROUTINE_PAGABLE,
  169. DCERROR_PENDING_BIT_NOT_MIGRATED,
  170. DCERROR_CANCELROUTINE_ON_FORWARDED_IRP,
  171. DCERROR_PNP_IRP_NEEDS_PDO_HANDLING,
  172. DCERROR_TARGET_RELATION_LIST_EMPTY,
  173. DCERROR_TARGET_RELATION_NEEDS_REF,
  174. DCERROR_BOGUS_PNP_IRP_COMPLETED,
  175. DCERROR_SUCCESSFUL_PNP_IRP_NOT_FORWARDED,
  176. DCERROR_UNTOUCHED_PNP_IRP_NOT_FORWARDED,
  177. DCERROR_BOGUS_POWER_IRP_COMPLETED,
  178. DCERROR_SUCCESSFUL_POWER_IRP_NOT_FORWARDED,
  179. DCERROR_UNTOUCHED_POWER_IRP_NOT_FORWARDED,
  180. DCERROR_PNP_QUERY_CAP_BAD_VERSION,
  181. DCERROR_PNP_QUERY_CAP_BAD_SIZE,
  182. DCERROR_PNP_QUERY_CAP_BAD_ADDRESS,
  183. DCERROR_PNP_QUERY_CAP_BAD_UI_NUM,
  184. DCERROR_RESTRICTED_IRP,
  185. DCERROR_REINIT_OF_ALLOCATED_IRP_WITHOUT_QUOTA,
  186. DCERROR_UNFORWARDED_IRP_COMPLETED,
  187. DCERROR_DISPATCH_CALLED_AT_BAD_IRQL,
  188. DCERROR_BOGUS_MINOR_STATUS_TRASHED,
  189. DCERROR_CANCELROUTINE_AFTER_COMPLETION,
  190. DCERROR_PENDING_RETURNED_NOT_MARKED,
  191. DCERROR_PENDING_MARKED_NOT_RETURNED,
  192. DCERROR_POWER_PAGABLE_NOT_INHERITED,
  193. DCERROR_DOUBLE_DELETION,
  194. DCERROR_DETACHED_IN_SURPRISE_REMOVAL,
  195. DCERROR_DELETED_IN_SURPRISE_REMOVAL,
  196. DCERROR_DO_INITIALIZING_NOT_CLEARED,
  197. DCERROR_DO_FLAG_NOT_COPIED,
  198. DCERROR_INCONSISTANT_DO_FLAGS,
  199. DCERROR_DEVICE_TYPE_NOT_COPIED,
  200. DCERROR_NON_FAILABLE_IRP,
  201. DCERROR_NON_PDO_RETURNED_IN_RELATION,
  202. DCERROR_DUPLICATE_ENUMERATION,
  203. DCERROR_FILE_IO_AT_BAD_IRQL,
  204. DCERROR_MISHANDLED_TARGET_DEVICE_RELATIONS,
  205. DCERROR_PENDING_RETURNED_NOT_MARKED_2,
  206. DCERROR_DDI_REQUIRES_PDO,
  207. DCERROR_MAXIMUM
  208. } DCERROR_ID;