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.

123 lines
3.8 KiB

  1. #ifndef _HSMWORKI_
  2. #define _HSMWORKI_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. HSMWORKI.H
  7. Abstract:
  8. This class represents an HSM work item - a unit of work
  9. that is performed by the HSM engine
  10. Author:
  11. Cat Brant [cbrant] 5-May-1997
  12. Revision History:
  13. --*/
  14. #include "resource.h" // main symbols
  15. #include "job.h"
  16. #include "task.h"
  17. /*++
  18. Class Name:
  19. CHsmWorkItem
  20. Class Description:
  21. --*/
  22. class CHsmWorkItem :
  23. public CWsbObject,
  24. public IHsmWorkItem,
  25. public CComCoClass<CHsmWorkItem,&CLSID_CHsmWorkItem>
  26. {
  27. public:
  28. CHsmWorkItem() {}
  29. BEGIN_COM_MAP(CHsmWorkItem)
  30. COM_INTERFACE_ENTRY(IHsmWorkItem)
  31. COM_INTERFACE_ENTRY(IPersistStream)
  32. COM_INTERFACE_ENTRY(IWsbCollectable)
  33. COM_INTERFACE_ENTRY(IWsbTestable)
  34. END_COM_MAP()
  35. DECLARE_REGISTRY_RESOURCEID( IDR_CHsmWorkItem )
  36. // CWsbCollectable
  37. public:
  38. STDMETHOD(FinalConstruct)(void);
  39. void FinalRelease(void);
  40. // IPersist
  41. public:
  42. STDMETHOD(GetClassID)(LPCLSID pClsid);
  43. // IPersistStream
  44. public:
  45. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  46. STDMETHOD(Load)(IStream* pStream);
  47. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  48. // IWsbCollectable
  49. public:
  50. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  51. // IWsbTestable
  52. public:
  53. STDMETHOD(Test)(USHORT *pTestsPassed, USHORT* pTestsFailed);
  54. // IHsmWorkItem
  55. public:
  56. STDMETHOD(CompareToIHsmWorkItem)(IHsmWorkItem* pWorkItem, SHORT* pResult);
  57. STDMETHOD(GetFsaPostIt)(IFsaPostIt **ppFsaPostIt);
  58. STDMETHOD(GetFsaResource)(IFsaResource **ppFsaResource);
  59. STDMETHOD(GetId)(GUID *pId);
  60. STDMETHOD(GetMediaInfo)(GUID *pMediaId, FILETIME *pMediaLastUpdate,
  61. HRESULT *pMediaLastError, BOOL *pMediaRecallOnly,
  62. LONGLONG *pMediaFreeBytes, short *pMediaRemoteDataSet);
  63. STDMETHOD(GetResult)(HRESULT *pHr);
  64. STDMETHOD(GetWorkType)(HSM_WORK_ITEM_TYPE *pWorkType);
  65. STDMETHOD(SetFsaPostIt)(IFsaPostIt *pFsaPostIt);
  66. STDMETHOD(SetFsaResource)(IFsaResource *pFsaResource);
  67. STDMETHOD(SetMediaInfo)(GUID mediaId, FILETIME mediaLastUpdate,
  68. HRESULT mediaLastError, BOOL mediaRecallOnly,
  69. LONGLONG mediaFreeBytes, short mediaRemoteDataSet);
  70. STDMETHOD(SetResult)(HRESULT hr);
  71. STDMETHOD(SetWorkType)(HSM_WORK_ITEM_TYPE workType);
  72. protected:
  73. HSM_WORK_ITEM_TYPE m_WorkType; // Type of work to do
  74. CComPtr<IFsaPostIt> m_pFsaPostIt; // FSA work to do
  75. HRESULT m_WorkResult; // Result of premigrate
  76. CComPtr<IFsaResource> m_pFsaResource; // Resource that had work
  77. // Information about media containing the data - premigrates only
  78. GUID m_MyId; // Identifier for database searches
  79. GUID m_MediaId; // HSM Engine Media ID
  80. FILETIME m_MediaLastUpdate; // Last update of copy
  81. HRESULT m_MediaLastError; // S_OK or the last exception
  82. // ..encountered when accessing
  83. // ..the media
  84. BOOL m_MediaRecallOnly; // True if no more data is to
  85. // ..be premigrated to the media
  86. // ..Set by internal operations,
  87. // ..may not be changed externally
  88. LONGLONG m_MediaFreeBytes; // Real free space on media
  89. SHORT m_MediaRemoteDataSet; // Next remote data set
  90. };
  91. #endif // _HSMWORKI_