Source code of Windows XP (NT5)
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.

212 lines
5.5 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. VOID
  78. VfMajorInit(
  79. VOID
  80. );
  81. VOID
  82. FASTCALL
  83. VfMajorRegisterHandlers(
  84. IN UCHAR IrpMajorCode,
  85. IN PFN_DUMP_IRP_STACK DumpIrpStack OPTIONAL,
  86. IN PFN_VERIFY_NEW_REQUEST VerifyNewRequest OPTIONAL,
  87. IN PFN_VERIFY_IRP_STACK_DOWNWARD VerifyStackDownward OPTIONAL,
  88. IN PFN_VERIFY_IRP_STACK_UPWARD VerifyStackUpward OPTIONAL,
  89. IN PFN_IS_SYSTEM_RESTRICTED_IRP IsSystemRestrictedIrp OPTIONAL,
  90. IN PFN_ADVANCE_IRP_STATUS AdvanceIrpStatus OPTIONAL,
  91. IN PFN_IS_VALID_IRP_STATUS IsValidIrpStatus OPTIONAL,
  92. IN PFN_IS_NEW_REQUEST IsNewRequest OPTIONAL,
  93. IN PFN_VERIFY_NEW_IRP VerifyNewIrp OPTIONAL,
  94. IN PFN_VERIFY_FINAL_IRP_STACK VerifyFinalIrpStack OPTIONAL,
  95. IN PFN_TEST_STARTED_PDO_STACK TestStartedPdoStack OPTIONAL
  96. );
  97. VOID
  98. FASTCALL
  99. VfMajorDumpIrpStack(
  100. IN PIO_STACK_LOCATION IrpSp
  101. );
  102. VOID
  103. FASTCALL
  104. VfMajorVerifyNewRequest(
  105. IN PIOV_REQUEST_PACKET IovPacket,
  106. IN PDEVICE_OBJECT DeviceObject,
  107. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  108. IN PIO_STACK_LOCATION IrpSp,
  109. IN PIOV_STACK_LOCATION StackLocationData,
  110. IN PVOID CallerAddress OPTIONAL
  111. );
  112. VOID
  113. FASTCALL
  114. VfMajorVerifyIrpStackDownward(
  115. IN PIOV_REQUEST_PACKET IovPacket,
  116. IN PDEVICE_OBJECT DeviceObject,
  117. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  118. IN PIO_STACK_LOCATION IrpSp,
  119. IN PIOV_STACK_LOCATION StackLocationData,
  120. IN PVOID CallerAddress OPTIONAL
  121. );
  122. VOID
  123. FASTCALL
  124. VfMajorVerifyIrpStackUpward(
  125. IN PIOV_REQUEST_PACKET IovPacket,
  126. IN PIO_STACK_LOCATION IrpSp,
  127. IN PIOV_STACK_LOCATION StackLocationData,
  128. IN BOOLEAN IsNewlyCompleted,
  129. IN BOOLEAN RequestFinalized
  130. );
  131. BOOLEAN
  132. FASTCALL
  133. VfMajorIsSystemRestrictedIrp(
  134. IN PIO_STACK_LOCATION IrpSp
  135. );
  136. BOOLEAN
  137. FASTCALL
  138. VfMajorAdvanceIrpStatus(
  139. IN PIO_STACK_LOCATION IrpSp,
  140. IN NTSTATUS OriginalStatus,
  141. IN OUT NTSTATUS *StatusToAdvance
  142. );
  143. BOOLEAN
  144. FASTCALL
  145. VfMajorIsValidIrpStatus(
  146. IN PIO_STACK_LOCATION IrpSp,
  147. IN NTSTATUS Status
  148. );
  149. BOOLEAN
  150. FASTCALL
  151. VfMajorIsNewRequest(
  152. IN PIO_STACK_LOCATION IrpLastSp OPTIONAL,
  153. IN PIO_STACK_LOCATION IrpSp
  154. );
  155. VOID
  156. FASTCALL
  157. VfMajorVerifyNewIrp(
  158. IN PIOV_REQUEST_PACKET IovPacket,
  159. IN PIRP Irp,
  160. IN PIO_STACK_LOCATION IrpSp,
  161. IN PIOV_STACK_LOCATION StackLocationData,
  162. IN PVOID CallerAddress OPTIONAL
  163. );
  164. VOID
  165. FASTCALL
  166. VfMajorVerifyFinalIrpStack(
  167. IN PIOV_REQUEST_PACKET IovPacket,
  168. IN PIO_STACK_LOCATION IrpSp
  169. );
  170. VOID
  171. FASTCALL
  172. VfMajorTestStartedPdoStack(
  173. IN PDEVICE_OBJECT PhysicalDeviceObject
  174. );