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.

166 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vfpacket.h
  5. Abstract:
  6. This header exposes functions used to manage the verifier packet data that
  7. tracks IRPs.
  8. Author:
  9. Adrian J. Oney (adriao) 20-Apr-1998
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. AdriaO 05/02/2000 - Seperated out from ntos\io\hashirp.h
  14. --*/
  15. //
  16. // Currently, ntddk.h uses up to 0x2000 for Irp->Flags
  17. //
  18. #define IRPFLAG_EXAMINE_MASK 0xC0000000
  19. #define IRPFLAG_EXAMINE_NOT_TRACKED 0x80000000
  20. #define IRPFLAG_EXAMINE_TRACKED 0x40000000
  21. #define IRPFLAG_EXAMINE_UNMARKED 0x00000000
  22. #define TRACKFLAG_ACTIVE 0x00000001
  23. #define IRP_ALLOC_COUNT 8
  24. #define IRP_LOG_ENTRIES 16
  25. typedef enum {
  26. IOV_EVENT_NONE = 0,
  27. IOV_EVENT_IO_ALLOCATE_IRP,
  28. IOV_EVENT_IO_CALL_DRIVER,
  29. IOV_EVENT_IO_CALL_DRIVER_UNWIND,
  30. IOV_EVENT_IO_COMPLETE_REQUEST,
  31. IOV_EVENT_IO_COMPLETION_ROUTINE,
  32. IOV_EVENT_IO_COMPLETION_ROUTINE_UNWIND,
  33. IOV_EVENT_IO_CANCEL_IRP,
  34. IOV_EVENT_IO_FREE_IRP
  35. } IOV_LOG_EVENT;
  36. typedef struct {
  37. IOV_LOG_EVENT Event;
  38. PETHREAD Thread;
  39. PVOID Address;
  40. ULONG_PTR Data;
  41. LARGE_INTEGER TimeStamp;
  42. } IOV_LOG_ENTRY, *PIOV_LOG_ENTRY;
  43. struct _IOV_SESSION_DATA;
  44. struct _IOV_REQUEST_PACKET;
  45. typedef struct _IOV_SESSION_DATA *PIOV_SESSION_DATA;
  46. typedef struct _IOV_REQUEST_PACKET *PIOV_REQUEST_PACKET;
  47. typedef struct _IOV_REQUEST_PACKET {
  48. IOV_DATABASE_HEADER;
  49. ULONG Flags;
  50. KIRQL DepartureIrql; // Irql IRP will be dispatched at.
  51. KIRQL ArrivalIrql; // Irql IRP was sent in at.
  52. LIST_ENTRY SessionHead; // List of all sessions.
  53. CCHAR StackCount; // StackCount of tracked IRP.
  54. ULONG QuotaCharge; // Quota charged against IRP.
  55. PEPROCESS QuotaProcess; // Process quota was charged to.
  56. PIO_COMPLETION_ROUTINE RealIrpCompletionRoutine;
  57. UCHAR RealIrpControl;
  58. PVOID RealIrpContext;
  59. PVOID AllocatorStack[IRP_ALLOC_COUNT];
  60. //
  61. // The following information is for the assertion routines to read.
  62. //
  63. UCHAR TopStackLocation;
  64. CCHAR PriorityBoost; // Boost from IofCompleteRequest
  65. UCHAR LastLocation; // Last location from IofCallDriver
  66. ULONG RefTrackingCount;
  67. //
  68. // This field is only set on surrogate IRPs, and contains the locked system
  69. // VA for the destination of a direct I/O IRP that's being buffered.
  70. //
  71. PUCHAR SystemDestVA;
  72. #if DBG
  73. IOV_LOG_ENTRY LogEntries[IRP_LOG_ENTRIES];
  74. ULONG LogEntryHead;
  75. ULONG LogEntryTail;
  76. #endif
  77. PVERIFIER_SETTINGS_SNAPSHOT VerifierSettings;
  78. PIOV_SESSION_DATA pIovSessionData;
  79. } IOV_REQUEST_PACKET;
  80. PIOV_REQUEST_PACKET
  81. FASTCALL
  82. VfPacketCreateAndLock(
  83. IN PIRP Irp
  84. );
  85. PIOV_REQUEST_PACKET
  86. FASTCALL
  87. VfPacketFindAndLock(
  88. IN PIRP Irp
  89. );
  90. VOID
  91. FASTCALL
  92. VfPacketAcquireLock(
  93. IN PIOV_REQUEST_PACKET IrpTrackingData
  94. );
  95. VOID
  96. FASTCALL
  97. VfPacketReleaseLock(
  98. IN PIOV_REQUEST_PACKET IrpTrackingData
  99. );
  100. VOID
  101. FASTCALL
  102. VfPacketReference(
  103. IN PIOV_REQUEST_PACKET IovPacket,
  104. IN IOV_REFERENCE_TYPE IovRefType
  105. );
  106. VOID
  107. FASTCALL
  108. VfPacketDereference(
  109. IN PIOV_REQUEST_PACKET IovPacket,
  110. IN IOV_REFERENCE_TYPE IovRefType
  111. );
  112. PIOV_SESSION_DATA
  113. FASTCALL
  114. VfPacketGetCurrentSessionData(
  115. IN PIOV_REQUEST_PACKET IovPacket
  116. );
  117. VOID
  118. FASTCALL
  119. VfPacketLogEntry(
  120. IN PIOV_REQUEST_PACKET IovPacket,
  121. IN IOV_LOG_EVENT IovLogEvent,
  122. IN PVOID Address,
  123. IN ULONG_PTR Data
  124. );