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.

146 lines
4.9 KiB

  1. #ifndef _HSMRECLI_
  2. #define _HSMRECLI_
  3. /*++
  4. Module Name:
  5. HSMRECLI.H
  6. Abstract:
  7. This class represents an HSM work item - a unit of work
  8. that is performed by the HSM engine
  9. Author:
  10. Ravisankar Pudipeddi [ravisp]
  11. Revision History:
  12. --*/
  13. #include "resource.h" // main symbols
  14. #include "job.h"
  15. #include "task.h"
  16. /*++
  17. Class Name:
  18. CHsmRecallItem
  19. Class Description:
  20. --*/
  21. class CHsmRecallItem :
  22. public CWsbObject,
  23. public IHsmRecallItem,
  24. public CComCoClass<CHsmRecallItem,&CLSID_CHsmRecallItem>
  25. {
  26. public:
  27. CHsmRecallItem() {}
  28. BEGIN_COM_MAP(CHsmRecallItem)
  29. COM_INTERFACE_ENTRY(IHsmRecallItem)
  30. COM_INTERFACE_ENTRY(IPersistStream)
  31. COM_INTERFACE_ENTRY(IWsbCollectable)
  32. COM_INTERFACE_ENTRY(IWsbTestable)
  33. END_COM_MAP()
  34. DECLARE_REGISTRY_RESOURCEID( IDR_CHsmRecallItem )
  35. // CWsbCollectable
  36. public:
  37. STDMETHOD(FinalConstruct)(void);
  38. void FinalRelease(void);
  39. // IPersist
  40. public:
  41. STDMETHOD(GetClassID)(LPCLSID pClsid);
  42. // IPersistStream
  43. public:
  44. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  45. STDMETHOD(Load)(IStream* pStream);
  46. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  47. // IWsbCollectable
  48. public:
  49. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  50. // IWsbTestable
  51. public:
  52. STDMETHOD(Test)(USHORT *pTestsPassed, USHORT* pTestsFailed);
  53. // IHsmRecallItem
  54. public:
  55. STDMETHOD(CompareToIHsmRecallItem)(IHsmRecallItem* pWorkItem, SHORT* pResult);
  56. STDMETHOD(GetFsaPostIt)(IFsaPostIt **ppFsaPostIt);
  57. STDMETHOD(GetFsaResource)(IFsaResource **ppFsaResource);
  58. STDMETHOD(GetId)(GUID *pId);
  59. STDMETHOD(GetMediaInfo)(GUID *pMediaId, FILETIME *pMediaLastUpdate,
  60. HRESULT *pMediaLastError, BOOL *pMediaRecallOnly,
  61. LONGLONG *pMediaFreeBytes, short *pMediaRemoteDataSet);
  62. STDMETHOD(GetResult)(HRESULT *pHr);
  63. STDMETHOD(GetWorkType)(HSM_WORK_ITEM_TYPE *pWorkType);
  64. STDMETHOD(GetEventCookie)(OUT DWORD *pEventCookie);
  65. STDMETHOD(GetStateCookie)(OUT DWORD *pStateCookie);
  66. STDMETHOD(GetJobState)(OUT HSM_JOB_STATE *pJobState);
  67. STDMETHOD(GetJobPhase)(OUT HSM_JOB_PHASE *pJobPhase);
  68. STDMETHOD(GetSeekOffset)(OUT LONGLONG *pSeekOffset);
  69. STDMETHOD(GetBagId)(OUT GUID *bagId);
  70. STDMETHOD(GetDataSetStart)(OUT LONGLONG *dataSetStart);
  71. STDMETHOD(SetFsaPostIt)(IFsaPostIt *pFsaPostIt);
  72. STDMETHOD(SetFsaResource)(IFsaResource *pFsaResource);
  73. STDMETHOD(SetMediaInfo)(GUID mediaId, FILETIME mediaLastUpdate,
  74. HRESULT mediaLastError, BOOL mediaRecallOnly,
  75. LONGLONG mediaFreeBytes, short mediaRemoteDataSet);
  76. STDMETHOD(SetResult)(HRESULT hr);
  77. STDMETHOD(SetWorkType)(HSM_WORK_ITEM_TYPE workType);
  78. STDMETHOD(SetEventCookie)(IN DWORD eventCookie);
  79. STDMETHOD(SetStateCookie)(IN DWORD stateCookie);
  80. STDMETHOD(SetJobState)(IN HSM_JOB_STATE jobState);
  81. STDMETHOD(SetJobPhase)(IN HSM_JOB_PHASE jobPhase);
  82. STDMETHOD(SetSeekOffset)(IN LONGLONG seekOffset);
  83. STDMETHOD(SetBagId)(IN GUID *bagId);
  84. STDMETHOD(SetDataSetStart)(IN LONGLONG dataSetStart);
  85. protected:
  86. HSM_WORK_ITEM_TYPE m_WorkType; // Type of work to do
  87. CComPtr<IFsaPostIt> m_pFsaPostIt; // FSA work to do
  88. HRESULT m_WorkResult; // Result of premigrate
  89. CComPtr<IFsaResource> m_pFsaResource; // Resource that had work
  90. // Information about media containing the data - premigrates only
  91. GUID m_MyId; // Identifier for database searches
  92. GUID m_MediaId; // HSM Engine Media ID
  93. FILETIME m_MediaLastUpdate; // Last update of copy
  94. HRESULT m_MediaLastError; // S_OK or the last exception
  95. // ..encountered when accessing
  96. // ..the media
  97. BOOL m_MediaRecallOnly; // True if no more data is to
  98. // ..be premigrated to the media
  99. // ..Set by internal operations,
  100. // ..may not be changed externally
  101. LONGLONG m_MediaFreeBytes; // Real free space on media
  102. SHORT m_MediaRemoteDataSet; // Next remote data set
  103. DWORD m_EventCookie;
  104. DWORD m_StateCookie;
  105. HSM_JOB_STATE m_JobState;
  106. HSM_JOB_PHASE m_JobPhase;
  107. LONGLONG m_SeekOffset; //parameter used to order the work-item in the queue
  108. GUID m_BagId;
  109. LONGLONG m_DataSetStart;
  110. };
  111. #endif // _HSMRECLI_