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.

136 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vfirpdb.h
  5. Abstract:
  6. This header exposes prototypes for functions used to manage the database of
  7. IRP tracking data.
  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. struct _IOV_DATABASE_HEADER;
  16. typedef struct _IOV_DATABASE_HEADER IOV_DATABASE_HEADER;
  17. typedef struct _IOV_DATABASE_HEADER *PIOV_DATABASE_HEADER;
  18. typedef enum _IOV_REFERENCE_TYPE {
  19. IOVREFTYPE_PACKET = 0,
  20. IOVREFTYPE_POINTER
  21. } IOV_REFERENCE_TYPE;
  22. typedef enum {
  23. IRPDBEVENT_POINTER_COUNT_ZERO = 1,
  24. IRPDBEVENT_REFERENCE_COUNT_ZERO
  25. } IRP_DATABASE_EVENT;
  26. typedef VOID (*PFN_IRPDBEVENT_CALLBACK)(
  27. IN PIOV_DATABASE_HEADER IovHeader,
  28. IN PIRP TrackedIrp OPTIONAL,
  29. IN IRP_DATABASE_EVENT Event
  30. );
  31. typedef struct _IOV_DATABASE_HEADER {
  32. PIRP TrackedIrp; // Tracked IRP
  33. KSPIN_LOCK HeaderLock; // Spinlock on data structure
  34. KIRQL LockIrql; // IRQL taken at.
  35. LONG ReferenceCount; // # of reasons to keep this packet
  36. LONG PointerCount; // # of reasons to track by irp addr
  37. ULONG HeaderFlags;
  38. LIST_ENTRY HashLink; // Link in hash table.
  39. LIST_ENTRY ChainLink; // Head is HeadPacket
  40. PIOV_DATABASE_HEADER ChainHead; // First packet in a chain.
  41. PFN_IRPDBEVENT_CALLBACK NotificationCallback;
  42. };
  43. VOID
  44. FASTCALL
  45. VfIrpDatabaseInit(
  46. VOID
  47. );
  48. BOOLEAN
  49. FASTCALL
  50. VfIrpDatabaseEntryInsertAndLock(
  51. IN PIRP Irp,
  52. IN PFN_IRPDBEVENT_CALLBACK NotificationCallback,
  53. IN OUT PIOV_DATABASE_HEADER IovHeader
  54. );
  55. PIOV_DATABASE_HEADER
  56. FASTCALL
  57. VfIrpDatabaseEntryFindAndLock(
  58. IN PIRP Irp
  59. );
  60. VOID
  61. FASTCALL
  62. VfIrpDatabaseEntryAcquireLock(
  63. IN PIOV_DATABASE_HEADER IovHeader OPTIONAL
  64. );
  65. VOID
  66. FASTCALL
  67. VfIrpDatabaseEntryReleaseLock(
  68. IN PIOV_DATABASE_HEADER IovHeader
  69. );
  70. VOID
  71. FASTCALL
  72. VfIrpDatabaseEntryReference(
  73. IN PIOV_DATABASE_HEADER IovHeader,
  74. IN IOV_REFERENCE_TYPE IovRefType
  75. );
  76. VOID
  77. FASTCALL
  78. VfIrpDatabaseEntryDereference(
  79. IN PIOV_DATABASE_HEADER IovHeader,
  80. IN IOV_REFERENCE_TYPE IovRefType
  81. );
  82. VOID
  83. FASTCALL
  84. VfIrpDatabaseEntryAppendToChain(
  85. IN OUT PIOV_DATABASE_HEADER IovExistingHeader,
  86. IN OUT PIOV_DATABASE_HEADER IovNewHeader
  87. );
  88. VOID
  89. FASTCALL
  90. VfIrpDatabaseEntryRemoveFromChain(
  91. IN OUT PIOV_DATABASE_HEADER IovHeader
  92. );
  93. PIOV_DATABASE_HEADER
  94. FASTCALL
  95. VfIrpDatabaseEntryGetChainPrevious(
  96. IN PIOV_DATABASE_HEADER IovHeader
  97. );
  98. PIOV_DATABASE_HEADER
  99. FASTCALL
  100. VfIrpDatabaseEntryGetChainNext(
  101. IN PIOV_DATABASE_HEADER IovHeader
  102. );