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.

140 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. workque.h
  5. Abstract:
  6. This module defines the data structures and routines used for the FSP
  7. dispatching code.
  8. Author:
  9. Larry Osterman (LarryO) 13-Aug-1990
  10. Revision History:
  11. 13-Aug-1990 LarryO
  12. Created
  13. --*/
  14. #ifndef _WORKQUE_
  15. #define _WORKQUE_
  16. typedef struct _IRP_QUEUE {
  17. LIST_ENTRY Queue; // Queue itself.
  18. } IRP_QUEUE, *PIRP_QUEUE;
  19. struct _BOWSER_FS_DEVICE_OBJECT;
  20. //
  21. // IRP Context.
  22. //
  23. // The IRP context is a wrapper that used when passing an IRP from the
  24. // redirectors FSD to its FSP.
  25. //
  26. typedef
  27. struct _IRP_CONTEXT {
  28. WORK_QUEUE_ITEM WorkHeader;
  29. PIRP Irp;
  30. struct _BOWSER_FS_DEVICE_OBJECT *DeviceObject;
  31. } IRP_CONTEXT, *PIRP_CONTEXT;
  32. VOID
  33. BowserQueueCriticalWorkItem (
  34. IN PWORK_QUEUE_ITEM WorkItem
  35. );
  36. VOID
  37. BowserQueueDelayedWorkItem (
  38. IN PWORK_QUEUE_ITEM WorkItem
  39. );
  40. PIRP_CONTEXT
  41. BowserAllocateIrpContext(
  42. VOID
  43. );
  44. VOID
  45. BowserFreeIrpContext(
  46. PIRP_CONTEXT IrpContext
  47. );
  48. VOID
  49. BowserInitializeIrpQueue(
  50. PIRP_QUEUE Queue
  51. );
  52. VOID
  53. BowserUninitializeIrpQueue(
  54. PIRP_QUEUE Queue
  55. );
  56. VOID
  57. BowserCancelQueuedRequest(
  58. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  59. IN PIRP Irp
  60. );
  61. VOID
  62. BowserCancelQueuedIoForFile(
  63. IN PIRP_QUEUE Queue,
  64. IN PFILE_OBJECT FileObject
  65. );
  66. NTSTATUS
  67. BowserQueueNonBufferRequest(
  68. IN PIRP Irp,
  69. IN PIRP_QUEUE Queue,
  70. IN PDRIVER_CANCEL CancelRoutine
  71. );
  72. NTSTATUS
  73. BowserQueueNonBufferRequestReferenced(
  74. IN PIRP Irp,
  75. IN PIRP_QUEUE Queue,
  76. IN PDRIVER_CANCEL CancelRoutine
  77. );
  78. VOID
  79. BowserTimeoutQueuedIrp(
  80. IN PIRP_QUEUE Queue,
  81. IN ULONG NumberOfSecondsToTimeOut
  82. );
  83. PIRP
  84. BowserDequeueQueuedIrp(
  85. IN PIRP_QUEUE Queue
  86. );
  87. VOID
  88. BowserInitializeIrpContext(
  89. VOID
  90. );
  91. VOID
  92. BowserpUninitializeIrpContext(
  93. VOID
  94. );
  95. VOID
  96. BowserpInitializeIrpQueue(
  97. VOID
  98. );
  99. //
  100. // Returns TRUE if there are no entries in the IRP queue.
  101. //
  102. #define BowserIsIrpQueueEmpty(IrpQueue) IsListEmpty(&(IrpQueue)->Queue)
  103. #endif // _WORKQUE_