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.

93 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. store.h
  5. Abstract:
  6. AC Storage Manager
  7. Author:
  8. Erez Haba (erezh) 5-May-96
  9. Revision History:
  10. --*/
  11. #ifndef __STORE_H
  12. #define __STORE_H
  13. #include "irplist.h"
  14. #include "packet.h"
  15. //---------------------------------------------------------
  16. //
  17. // class CStorage
  18. //
  19. //---------------------------------------------------------
  20. class CStorage {
  21. public:
  22. void HoldWriteRequest(PIRP irp);
  23. PIRP GetWriteRequest(CPacket * pContext);
  24. private:
  25. CIRPList m_writers;
  26. };
  27. //---------------------------------------------------------
  28. //
  29. // class CStorageComplete
  30. //
  31. //---------------------------------------------------------
  32. class CStorageComplete {
  33. public:
  34. CStorageComplete();
  35. ~CStorageComplete();
  36. bool AllocateWorkItem(PDEVICE_OBJECT pDevice);
  37. void HoldNotification(PIRP irp);
  38. private:
  39. void CompleteStorage();
  40. PIRP GetNotification();
  41. private:
  42. static void NTAPI WorkerRoutine(PDEVICE_OBJECT, PVOID);
  43. private:
  44. CIRPList m_notifications;
  45. PIO_WORKITEM m_pWorkItem;
  46. bool m_fWorkItemInQueue;
  47. };
  48. inline CStorageComplete::CStorageComplete() : m_pWorkItem(NULL), m_fWorkItemInQueue(false)
  49. {
  50. }
  51. inline CStorageComplete::~CStorageComplete()
  52. {
  53. if (m_pWorkItem != NULL)
  54. {
  55. IoFreeWorkItem(m_pWorkItem);
  56. }
  57. }
  58. inline bool CStorageComplete::AllocateWorkItem(PDEVICE_OBJECT pDevice)
  59. {
  60. ASSERT(m_pWorkItem == NULL);
  61. m_pWorkItem = IoAllocateWorkItem(pDevice);
  62. return (m_pWorkItem != NULL);
  63. }
  64. #endif // __STORE_H