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.

152 lines
5.0 KiB

  1. #ifndef _FSAFTRCL_
  2. #define _FSAFTRCL_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. fsaftrcl.h
  7. Abstract:
  8. This class represents a filter initiated recall request that is still in-progress.
  9. Author:
  10. Chuck Bardeen [cbardeen] 12-Feb-1997
  11. Revision History:
  12. --*/
  13. #include "resource.h" // main symbols
  14. #include "fsa.h"
  15. /*++
  16. Class Name:
  17. CFsaFilterRecall
  18. Class Description:
  19. This class represents a filter initiated recall request that is still in-progress.
  20. --*/
  21. class CFsaFilterRecall :
  22. public CWsbCollectable,
  23. public IFsaFilterRecall,
  24. public IFsaFilterRecallPriv,
  25. public CComCoClass<CFsaFilterRecall,&CLSID_CFsaFilterRecallNTFS>
  26. {
  27. public:
  28. CFsaFilterRecall() {}
  29. BEGIN_COM_MAP(CFsaFilterRecall)
  30. COM_INTERFACE_ENTRY(IFsaFilterRecall)
  31. COM_INTERFACE_ENTRY(IFsaFilterRecallPriv)
  32. COM_INTERFACE_ENTRY(IWsbCollectable)
  33. COM_INTERFACE_ENTRY(IWsbTestable)
  34. END_COM_MAP()
  35. DECLARE_REGISTRY_RESOURCEID(IDR_FsaFilterRecall)
  36. // CComObjectRoot
  37. public:
  38. STDMETHOD(FinalConstruct)(void);
  39. void (FinalRelease)(void);
  40. #ifdef FSA_RECALL_LEAK_TEST
  41. STDMETHOD_(unsigned long, InternalAddRef)(void);
  42. STDMETHOD_(unsigned long, InternalRelease)(void);
  43. #endif
  44. // IWsbCollectable
  45. public:
  46. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  47. // IPersist
  48. public:
  49. STDMETHOD(GetClassID)(LPCLSID pClsid);
  50. // IPersistStream
  51. public:
  52. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  53. STDMETHOD(Load)(IStream* pStream);
  54. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  55. // IWsbTestable
  56. STDMETHOD(Test)(USHORT *passed, USHORT* failed);
  57. // IFsaFilterRecall
  58. public:
  59. STDMETHOD(CompareToIdentifier)(GUID id, SHORT* pResult);
  60. STDMETHOD(CompareToIRecall)(IFsaFilterRecall* pRecall, SHORT* pResult);
  61. STDMETHOD(CompareToDriversRecallId)(ULONGLONG id, SHORT* pResult);
  62. STDMETHOD(CompareToDriversContextId)(ULONGLONG id, SHORT* pResult);
  63. STDMETHOD(CompareBy)(FSA_RECALL_COMPARE by);
  64. STDMETHOD(GetIdentifier)(GUID* pId);
  65. STDMETHOD(GetMode)(ULONG* pMode);
  66. STDMETHOD(GetOffset)(LONGLONG* pOffset);
  67. STDMETHOD(GetPath)(OLECHAR** pName, ULONG bufferSize);
  68. STDMETHOD(GetResource)(IFsaResource** ppResource);
  69. STDMETHOD(GetRecallFlags)(ULONG* recallFlags);
  70. STDMETHOD(GetSession)(IHsmSession** ppSession);
  71. STDMETHOD(GetSize)(LONGLONG* pSize);
  72. STDMETHOD(GetState)(HSM_JOB_STATE* pState);
  73. STDMETHOD(GetUserName)(OLECHAR** pName, ULONG bufferSize);
  74. STDMETHOD(HasCompleted)(HRESULT resultHr);
  75. STDMETHOD(WasCancelled)(void);
  76. STDMETHOD(CreateLocalStream)(IStream **ppStream);
  77. STDMETHOD(CheckRecallLimit)(DWORD minRecallInterval, DWORD maxRecalls, BOOLEAN exemptAdmin);
  78. STDMETHOD(AddClient)(IFsaFilterClient *pWaitingClient);
  79. // IFsaFilterRecallPriv
  80. public:
  81. STDMETHOD(Cancel)(void);
  82. STDMETHOD(CancelByDriver)(void);
  83. STDMETHOD(Delete)(void);
  84. STDMETHOD(GetClient)(IFsaFilterClient** ppClient);
  85. STDMETHOD(GetDriversRecallId)(ULONGLONG* pId);
  86. STDMETHOD(SetDriversRecallId)(ULONGLONG pId);
  87. STDMETHOD(SetThreadId)(DWORD id);
  88. STDMETHOD(GetPlaceholder)(FSA_PLACEHOLDER* pPlaceholder);
  89. STDMETHOD(Init)(IFsaFilterClient* pClient, ULONGLONG pDriversRecallId, IFsaResource* pResource, OLECHAR* path, LONGLONG fileId, LONGLONG offset, LONGLONG size, ULONG mode, FSA_PLACEHOLDER* pPlaceholder, IFsaFilterPriv* pFilterPriv);
  90. STDMETHOD(SetIdentifier)(GUID id);
  91. STDMETHOD(StartRecall)(ULONGLONG offset, ULONGLONG size);
  92. STDMETHOD(GetStream)(IStream **ppStream);
  93. STDMETHOD(LogComplete)(HRESULT hr);
  94. protected:
  95. CComPtr<IFsaFilterClient> m_pClient;
  96. CComPtr<IWsbCollection> m_pWaitingClients;
  97. BOOL m_waitingClientsNotified;
  98. HANDLE m_waitingClientEvent;
  99. HANDLE m_notifyEvent; // An event for signaling on recall notify
  100. IFsaFilterPriv* m_pFilterPriv; // Parent Pointer, Weak Reference
  101. ULONGLONG m_driversRecallId;
  102. ULONG m_mode;
  103. LONGLONG m_offset;
  104. LONGLONG m_size;
  105. LONGLONG m_fileId;
  106. GUID m_id;
  107. CWsbStringPtr m_path;
  108. FSA_PLACEHOLDER m_placeholder;
  109. CComPtr<IFsaResource> m_pResource;
  110. CComPtr<IHsmSession> m_pSession;
  111. HSM_JOB_STATE m_state;
  112. BOOL m_wasCancelled;
  113. DWORD m_cookie;
  114. BOOL m_kernelCompletionSent;
  115. CComPtr<IDataMover> m_pDataMover;
  116. CComPtr<IStream> m_pStream;
  117. ULONG m_compareBy;
  118. FILETIME m_startTime;
  119. ULONG numRefs;
  120. ULONG m_recallFlags;
  121. DWORD m_threadId; //thread id of thread causing recall
  122. };
  123. #endif // _FSAFTRCL_