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.

229 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vfmajor.h
  5. Abstract:
  6. This header contains prototypes for per-major IRP code verification.
  7. Author:
  8. Adrian J. Oney (adriao) 09-May-1998
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. AdriaO 06/15/2000 - Seperated out from ntos\io\flunkirp.h
  13. --*/
  14. //
  15. // Use this major code to register a handler for default or all IRPs (context
  16. // specific to function)
  17. //
  18. #define IRP_MJ_ALL_MAJORS 0xFF
  19. typedef VOID (FASTCALL *PFN_DUMP_IRP_STACK)(
  20. IN PIO_STACK_LOCATION IrpSp
  21. );
  22. typedef VOID (FASTCALL *PFN_VERIFY_NEW_REQUEST)(
  23. IN PIOV_REQUEST_PACKET IrpTrackingData,
  24. IN PDEVICE_OBJECT DeviceObject,
  25. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  26. IN PIO_STACK_LOCATION IrpSp,
  27. IN PIOV_STACK_LOCATION StackLocationData,
  28. IN PVOID CallerAddress OPTIONAL
  29. );
  30. typedef VOID (FASTCALL *PFN_VERIFY_IRP_STACK_DOWNWARD)(
  31. IN PIOV_REQUEST_PACKET IovPacket,
  32. IN PDEVICE_OBJECT DeviceObject,
  33. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  34. IN PIO_STACK_LOCATION IrpSp,
  35. IN PIOV_STACK_LOCATION RequestHeadLocationData,
  36. IN PIOV_STACK_LOCATION StackLocationData,
  37. IN PVOID CallerAddress OPTIONAL
  38. );
  39. typedef VOID (FASTCALL *PFN_VERIFY_IRP_STACK_UPWARD)(
  40. IN PIOV_REQUEST_PACKET IovPacket,
  41. IN PIO_STACK_LOCATION IrpSp,
  42. IN PIOV_STACK_LOCATION RequestHeadLocationData,
  43. IN PIOV_STACK_LOCATION StackLocationData,
  44. IN BOOLEAN IsNewlyCompleted,
  45. IN BOOLEAN RequestFinalized
  46. );
  47. typedef BOOLEAN (FASTCALL *PFN_IS_SYSTEM_RESTRICTED_IRP)(
  48. IN PIO_STACK_LOCATION IrpSp
  49. );
  50. typedef BOOLEAN (FASTCALL *PFN_ADVANCE_IRP_STATUS)(
  51. IN PIO_STACK_LOCATION IrpSp,
  52. IN NTSTATUS OriginalStatus,
  53. IN OUT NTSTATUS *StatusToAdvance
  54. );
  55. typedef BOOLEAN (FASTCALL *PFN_IS_VALID_IRP_STATUS)(
  56. IN PIO_STACK_LOCATION IrpSp,
  57. IN NTSTATUS Status
  58. );
  59. typedef BOOLEAN (FASTCALL *PFN_IS_NEW_REQUEST)(
  60. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  61. IN PIO_STACK_LOCATION IrpSp
  62. );
  63. typedef VOID (FASTCALL *PFN_VERIFY_NEW_IRP)(
  64. IN PIOV_REQUEST_PACKET IovPacket,
  65. IN PIRP Irp,
  66. IN PIO_STACK_LOCATION IrpSp,
  67. IN PIOV_STACK_LOCATION StackLocationData,
  68. IN PVOID CallerAddress OPTIONAL
  69. );
  70. typedef VOID (FASTCALL *PFN_VERIFY_FINAL_IRP_STACK)(
  71. IN PIOV_REQUEST_PACKET IovPacket,
  72. IN PIO_STACK_LOCATION IrpSp
  73. );
  74. typedef VOID (FASTCALL *PFN_TEST_STARTED_PDO_STACK)(
  75. IN PDEVICE_OBJECT PhysicalDeviceObject
  76. );
  77. typedef LOGICAL (FASTCALL *PFN_BUILD_LOG_ENTRY)(
  78. IN PIRP Irp,
  79. IN ULONG CurrentCount,
  80. IN PIRPLOG_SNAPSHOT CurrentEntryArray,
  81. OUT PIRPLOG_SNAPSHOT IrpSnapshot
  82. );
  83. VOID
  84. VfMajorInit(
  85. VOID
  86. );
  87. VOID
  88. FASTCALL
  89. VfMajorRegisterHandlers(
  90. IN UCHAR IrpMajorCode,
  91. IN PFN_DUMP_IRP_STACK DumpIrpStack OPTIONAL,
  92. IN PFN_VERIFY_NEW_REQUEST VerifyNewRequest OPTIONAL,
  93. IN PFN_VERIFY_IRP_STACK_DOWNWARD VerifyStackDownward OPTIONAL,
  94. IN PFN_VERIFY_IRP_STACK_UPWARD VerifyStackUpward OPTIONAL,
  95. IN PFN_IS_SYSTEM_RESTRICTED_IRP IsSystemRestrictedIrp OPTIONAL,
  96. IN PFN_ADVANCE_IRP_STATUS AdvanceIrpStatus OPTIONAL,
  97. IN PFN_IS_VALID_IRP_STATUS IsValidIrpStatus OPTIONAL,
  98. IN PFN_IS_NEW_REQUEST IsNewRequest OPTIONAL,
  99. IN PFN_VERIFY_NEW_IRP VerifyNewIrp OPTIONAL,
  100. IN PFN_VERIFY_FINAL_IRP_STACK VerifyFinalIrpStack OPTIONAL,
  101. IN PFN_TEST_STARTED_PDO_STACK TestStartedPdoStack OPTIONAL,
  102. IN PFN_BUILD_LOG_ENTRY BuildIrpLogEntry OPTIONAL
  103. );
  104. VOID
  105. FASTCALL
  106. VfMajorDumpIrpStack(
  107. IN PIO_STACK_LOCATION IrpSp
  108. );
  109. VOID
  110. FASTCALL
  111. VfMajorVerifyNewRequest(
  112. IN PIOV_REQUEST_PACKET IovPacket,
  113. IN PDEVICE_OBJECT DeviceObject,
  114. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  115. IN PIO_STACK_LOCATION IrpSp,
  116. IN PIOV_STACK_LOCATION StackLocationData,
  117. IN PVOID CallerAddress OPTIONAL
  118. );
  119. VOID
  120. FASTCALL
  121. VfMajorVerifyIrpStackDownward(
  122. IN PIOV_REQUEST_PACKET IovPacket,
  123. IN PDEVICE_OBJECT DeviceObject,
  124. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  125. IN PIO_STACK_LOCATION IrpSp,
  126. IN PIOV_STACK_LOCATION StackLocationData,
  127. IN PVOID CallerAddress OPTIONAL
  128. );
  129. VOID
  130. FASTCALL
  131. VfMajorVerifyIrpStackUpward(
  132. IN PIOV_REQUEST_PACKET IovPacket,
  133. IN PIO_STACK_LOCATION IrpSp,
  134. IN PIOV_STACK_LOCATION StackLocationData,
  135. IN BOOLEAN IsNewlyCompleted,
  136. IN BOOLEAN RequestFinalized
  137. );
  138. BOOLEAN
  139. FASTCALL
  140. VfMajorIsSystemRestrictedIrp(
  141. IN PIO_STACK_LOCATION IrpSp
  142. );
  143. BOOLEAN
  144. FASTCALL
  145. VfMajorAdvanceIrpStatus(
  146. IN PIO_STACK_LOCATION IrpSp,
  147. IN NTSTATUS OriginalStatus,
  148. IN OUT NTSTATUS *StatusToAdvance
  149. );
  150. BOOLEAN
  151. FASTCALL
  152. VfMajorIsValidIrpStatus(
  153. IN PIO_STACK_LOCATION IrpSp,
  154. IN NTSTATUS Status
  155. );
  156. BOOLEAN
  157. FASTCALL
  158. VfMajorIsNewRequest(
  159. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  160. IN PIO_STACK_LOCATION IrpSp
  161. );
  162. VOID
  163. FASTCALL
  164. VfMajorVerifyNewIrp(
  165. IN PIOV_REQUEST_PACKET IovPacket,
  166. IN PIRP Irp,
  167. IN PIO_STACK_LOCATION IrpSp,
  168. IN PIOV_STACK_LOCATION StackLocationData,
  169. IN PVOID CallerAddress OPTIONAL
  170. );
  171. VOID
  172. FASTCALL
  173. VfMajorVerifyFinalIrpStack(
  174. IN PIOV_REQUEST_PACKET IovPacket,
  175. IN PIO_STACK_LOCATION IrpSp
  176. );
  177. VOID
  178. FASTCALL
  179. VfMajorTestStartedPdoStack(
  180. IN PDEVICE_OBJECT PhysicalDeviceObject
  181. );
  182. LOGICAL
  183. FASTCALL
  184. VfMajorBuildIrpLogEntry(
  185. IN PIRP Irp,
  186. IN ULONG CurrentCount,
  187. IN PIRPLOG_SNAPSHOT CurrentEntryArray,
  188. OUT PIRPLOG_SNAPSHOT IrpSnapshot
  189. );