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.

149 lines
6.3 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsSInfo.h
  5. Abstract:
  6. Declaration of the CRmsStorageInfo class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSSINFO_
  12. #define _RMSSINFO_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. /*++
  16. Class Name:
  17. CRmsStorageInfo
  18. Class Description:
  19. A CRmsStorageInfo represents storage information about a Cartridge, Partition, or
  20. MediaSet. Various statistics about an element are kept for an object of this
  21. type. These include the number of times a Cartridge, or Partition has been put into
  22. the element or taken from (get) the element.
  23. --*/
  24. class CRmsStorageInfo :
  25. public CComDualImpl<IRmsStorageInfo, &IID_IRmsStorageInfo, &LIBID_RMSLib>,
  26. public CRmsComObject
  27. {
  28. public:
  29. CRmsStorageInfo();
  30. // CRmsStorageInfo
  31. public:
  32. HRESULT GetSizeMax(ULARGE_INTEGER* pSize);
  33. HRESULT Load(IStream* pStream);
  34. HRESULT Save(IStream* pStream, BOOL clearDirty);
  35. HRESULT CompareTo(IUnknown* pCollectable, SHORT* pResult);
  36. HRESULT Test(USHORT *pPassed, USHORT *pFailed);
  37. // IRmsStorageInfo
  38. public:
  39. STDMETHOD(GetMountCounters)(LONG *pReads, LONG *pWrites);
  40. STDMETHOD(GetBytesRead2)(LONG *pReadHi, LONG *pReadLo);
  41. STDMETHOD(GetBytesRead)(LONGLONG *pRead);
  42. STDMETHOD(SetBytesRead2)(LONG readHi, LONG readLo);
  43. STDMETHOD(SetBytesRead)(LONGLONG read);
  44. STDMETHOD(IncrementBytesRead)(LONG val);
  45. STDMETHOD(GetBytesWritten2)(LONG *pWriteHi, LONG *pWriteLo);
  46. STDMETHOD(GetBytesWritten)(LONGLONG *pWritten);
  47. STDMETHOD(SetBytesWritten2)(LONG writeHi, LONG writeLo);
  48. STDMETHOD(SetBytesWritten)(LONGLONG written);
  49. STDMETHOD(IncrementBytesWritten)(LONG val);
  50. STDMETHOD(GetCapacity2)(LONG *pCapHi, LONG *pCapLo);
  51. STDMETHOD(GetCapacity)(LONGLONG *pCap);
  52. STDMETHOD(GetUsedSpace2)(LONG *pUsedHi, LONG *pUsedLo);
  53. STDMETHOD(GetUsedSpace)(LONGLONG *pUsed);
  54. STDMETHOD(GetLargestFreeSpace2)(LONG *pFreeHi, LONG *pFreeLo);
  55. STDMETHOD(GetLargestFreeSpace)(LONGLONG *pFree);
  56. STDMETHOD(SetCapacity)(IN LONGLONG cap);
  57. STDMETHOD(SetUsedSpace)(IN LONGLONG used);
  58. STDMETHOD(SetFreeSpace)(IN LONGLONG free);
  59. STDMETHOD(ResetCounters)(void);
  60. // STDMETHOD(ResetAllCounters)(void) = 0;
  61. STDMETHOD(GetResetCounterTimestamp)(DATE *pDate);
  62. STDMETHOD(GetLastReadTimestamp)(DATE *pDate);
  63. STDMETHOD(GetLastWriteTimestamp)(DATE *pDate);
  64. STDMETHOD(GetCreatedTimestamp)(DATE *pDate);
  65. ////////////////////////////////////////////////////////////////////////////////////////
  66. //
  67. // data members
  68. //
  69. protected:
  70. enum { // Class specific constants:
  71. //
  72. Version = 1, // Class version, this should be
  73. // incremented each time the
  74. // the class definition changes.
  75. }; //
  76. LONG m_readMountCounter; // A resetable counter holding
  77. // the number of times the storage object
  78. // has been mounted for read access.
  79. LONG m_writeMountCounter; // A resetable counter holding
  80. // the number of times the storage object
  81. // has been mounted for write access.
  82. LONGLONG m_bytesWrittenCounter; // Amount of data written to a storage
  83. // object.
  84. // Note: For some devices this has to be
  85. // provided by the application.
  86. LONGLONG m_bytesReadCounter; // Amount of data read from a storage
  87. // object.
  88. // Note: For some devices this has to be
  89. // provided by the application.
  90. LONGLONG m_capacity; // The total capacity, in bytes, of the
  91. // storage object. This is a best
  92. // guess for tape media. For media, the
  93. // value is usually provided by the device driver.
  94. LONGLONG m_usedSpace; // A calculated value that represents the
  95. // effective used space in the storage
  96. // object, in bytes. It is not necessarily
  97. // equal to the difference between the
  98. // capacity and largest free space. For
  99. // example, compressible media can effectively
  100. // hold significantly more data that non-compressible
  101. // media. In this case the free space is a
  102. // function of both compression ratio of the data
  103. // and the number of bytes written to the media.
  104. // Deleted files must be accounted for.
  105. LONGLONG m_largestFreeSpace; // Largest usable free space in the
  106. // storage object, in bytes. For media,
  107. // the value is usually provided
  108. // by the device driver. Negative numbers
  109. // indicate last known value for free space.
  110. DATE m_resetCounterTimestamp;// The date the counters were reset.
  111. DATE m_lastReadTimestamp; // The date of last access for read.
  112. DATE m_lastWriteTimestamp; // The date of last access of write.
  113. DATE m_createdTimestamp; // The date the storage object was created.
  114. };
  115. #endif // _RMSSINFO_