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.

136 lines
4.0 KiB

  1. #ifndef _HSMPHASE_
  2. #define _HSMPHASE_
  3. /*++
  4. 1998 Seagate Software, Inc. All rights reserved.
  5. Module Name:
  6. hsmsesst.h
  7. Abstract:
  8. This class is the phase component, which keeps track the status/totals for a phase of a
  9. session.
  10. Author:
  11. Chuck Bardeen [cbardeen] 14-Feb-1997
  12. Revision History:
  13. --*/
  14. #include "resource.h" // main symbols
  15. #include "wsb.h"
  16. #include "job.h"
  17. /*++
  18. Class Name:
  19. CHsmPhase
  20. This class is the phase component, which keeps track the status/totals for a phase of a
  21. session.
  22. Class Description:
  23. --*/
  24. class CHsmPhase :
  25. public CWsbObject,
  26. public IHsmPhase,
  27. public IHsmPhasePriv,
  28. public CComCoClass<CHsmPhase,&CLSID_CHsmPhase>
  29. {
  30. public:
  31. CHsmPhase() {}
  32. BEGIN_COM_MAP(CHsmPhase)
  33. COM_INTERFACE_ENTRY(IHsmPhase)
  34. COM_INTERFACE_ENTRY(IHsmPhasePriv)
  35. COM_INTERFACE_ENTRY(IWsbCollectable)
  36. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  37. COM_INTERFACE_ENTRY(IPersistStream)
  38. COM_INTERFACE_ENTRY(IWsbTestable)
  39. END_COM_MAP()
  40. DECLARE_REGISTRY_RESOURCEID(IDR_CHsmPhase)
  41. // CComObjectRoot
  42. public:
  43. STDMETHOD(FinalConstruct)(void);
  44. void FinalRelease(void);
  45. // IPersist
  46. public:
  47. STDMETHOD(GetClassID)(LPCLSID pClsid);
  48. // IPersistStream
  49. public:
  50. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  51. STDMETHOD(Load)(IStream* pStream);
  52. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  53. // IWsbCollectable
  54. public:
  55. STDMETHOD(CompareTo)(IUnknown* pUnknown, SHORT* pResult);
  56. // IWsbTestable
  57. public:
  58. STDMETHOD(Test)(USHORT *passed, USHORT* failed);
  59. // IHsmPhase
  60. public:
  61. STDMETHOD(Clone)(IHsmPhase** ppPhase);
  62. STDMETHOD(CompareToPhase)(HSM_JOB_PHASE phase, SHORT* pResult);
  63. STDMETHOD(CompareToIPhase)(IHsmPhase* pPhase, SHORT* pResult);
  64. STDMETHOD(CopyTo)(IHsmPhase* pPhase);
  65. STDMETHOD(GetElapsedTime)(ULONG* pDays, USHORT* pHours, USHORT* pMinutes, USHORT* pSeconds);
  66. STDMETHOD(GetMediaState)(HSM_JOB_MEDIA_STATE* pState);
  67. STDMETHOD(GetMediaStateAsString)(OLECHAR** pName, ULONG bufferSize);
  68. STDMETHOD(GetName)(OLECHAR** pName, ULONG bufferSize);
  69. STDMETHOD(GetPhase)(HSM_JOB_PHASE* pPhase);
  70. STDMETHOD(GetPriority)(HSM_JOB_PRIORITY* pPriority);
  71. STDMETHOD(GetPriorityAsString)(OLECHAR** pName, ULONG bufferSize);
  72. STDMETHOD(GetState)(HSM_JOB_STATE* pState);
  73. STDMETHOD(GetStateAsString)(OLECHAR** pName, ULONG bufferSize);
  74. STDMETHOD(GetStats)(LONGLONG* pItems, LONGLONG* pSize, LONGLONG* pSkippedItems, LONGLONG* pSkippedSize, LONGLONG* errorItems, LONGLONG* errorSize);
  75. STDMETHOD(GetStartTime)(FILETIME* pTime);
  76. STDMETHOD(GetStopTime)(FILETIME* pTime);
  77. // IHsmPhasePriv
  78. STDMETHOD(AddItem)(IFsaScanItem* pItem, HRESULT hrItem);
  79. STDMETHOD(Clone)(IHsmPhasePriv** ppPhasePriv);
  80. STDMETHOD(CopyTo)(IHsmPhasePriv* pPhasePriv);
  81. STDMETHOD(SetInternalStuff)(ULONG mountCount, ULONG transferCount, LONGLONG elapsedTime, FILETIME startTime, FILETIME restartTime, FILETIME stopTime);
  82. STDMETHOD(SetPhase)(HSM_JOB_PHASE phase);
  83. STDMETHOD(SetMediaState)(HSM_JOB_MEDIA_STATE state);
  84. STDMETHOD(SetPriority)(HSM_JOB_PRIORITY priority);
  85. STDMETHOD(SetState)(HSM_JOB_STATE state);
  86. STDMETHOD(SetStats)(LONGLONG items, LONGLONG size, LONGLONG skippedItems, LONGLONG skippedSize, LONGLONG errorItems, LONGLONG errorSize);
  87. protected:
  88. HSM_JOB_MEDIA_STATE m_mediaState;
  89. ULONG m_mountCount;
  90. ULONG m_transferCount;
  91. HSM_JOB_PHASE m_phase;
  92. HSM_JOB_PRIORITY m_priority;
  93. HSM_JOB_STATE m_state;
  94. LONGLONG m_items;
  95. LONGLONG m_size;
  96. LONGLONG m_skippedItems;
  97. LONGLONG m_skippedSize;
  98. LONGLONG m_errorItems;
  99. LONGLONG m_errorSize;
  100. LONGLONG m_elapsedTime;
  101. FILETIME m_startTime;
  102. FILETIME m_restartTime;
  103. FILETIME m_stopTime;
  104. };
  105. #endif // _HSMPHASE_