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.

125 lines
3.7 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsPartn.h
  5. Abstract:
  6. Declaration of the CRmsPartition class
  7. Author:
  8. Brian Dodd [brian] 19-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSPARTN_
  12. #define _RMSPARTN_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. #include "RmsSInfo.h" // CRmsStorageInfo
  16. /*++
  17. Class Name:
  18. CRmsPartition
  19. Class Description:
  20. A CRmsPartition represents a partition on a tape or a single side of
  21. a unit of optical media. This object keeps on-media identification
  22. information, and various statistics about the Partition including:
  23. capacity, free space, number of physical mounts issued for the
  24. particular Partition, and the amount of data read or written for the
  25. Partition.
  26. --*/
  27. class CRmsPartition :
  28. public CComDualImpl<IRmsPartition, &IID_IRmsPartition, &LIBID_RMSLib>,
  29. public CRmsStorageInfo, // inherits CRmsComObject
  30. public CWsbObject, // inherits CComObjectRoot
  31. public CComCoClass<CRmsPartition,&CLSID_CRmsPartition>
  32. {
  33. public:
  34. CRmsPartition() {}
  35. BEGIN_COM_MAP(CRmsPartition)
  36. COM_INTERFACE_ENTRY2(IDispatch, IRmsPartition)
  37. COM_INTERFACE_ENTRY(IRmsPartition)
  38. COM_INTERFACE_ENTRY(IRmsComObject)
  39. COM_INTERFACE_ENTRY(IRmsStorageInfo)
  40. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  41. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  42. COM_INTERFACE_ENTRY(IPersistStream)
  43. COM_INTERFACE_ENTRY(IWsbCollectable)
  44. // COM_INTERFACE_ENTRY(IWsbPersistable)
  45. COM_INTERFACE_ENTRY(IWsbTestable)
  46. END_COM_MAP()
  47. DECLARE_REGISTRY_RESOURCEID(IDR_RmsPartition)
  48. // CComObjectRoot
  49. public:
  50. STDMETHOD(FinalConstruct)(void);
  51. // IPersist
  52. public:
  53. STDMETHOD(GetClassID)(CLSID *pClsid);
  54. // IPersistStream
  55. public:
  56. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  57. STDMETHOD(Load)(IStream* pStream);
  58. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  59. // IWsbCollectable
  60. public:
  61. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  62. WSB_FROM_CWSBOBJECT;
  63. // IWsbTestable
  64. public:
  65. STDMETHOD(Test)(USHORT *pPassed, USHORT *pFailed);
  66. // IRmsPartition
  67. public:
  68. STDMETHOD(GetPartNo)(LONG *pPartNo);
  69. STDMETHOD(GetAttributes)(LONG *pAttr);
  70. STDMETHOD(SetAttributes)(LONG attr);
  71. STDMETHOD(GetIdentifier)(UCHAR *pIdent, SHORT *pSize);
  72. STDMETHOD(SetIdentifier)(UCHAR *pIdent, SHORT size);
  73. STDMETHOD(GetStorageInfo)(IRmsStorageInfo **ptr);
  74. STDMETHOD(VerifyIdentifier)(void);
  75. STDMETHOD(ReadOnMediaId)(UCHAR *pId, LONG *pSize);
  76. private:
  77. enum { // Class specific constants:
  78. //
  79. Version = 1, // Class version, this should be
  80. // incremented each time the
  81. // the class definition changes.
  82. MaxId = 64, // The maximum size of the on-media ID.
  83. // Note: this restritiction should
  84. // be eliminated when the DB records
  85. // are variable length.
  86. }; //
  87. LONG m_partNo; // The partition number or side.
  88. RmsAttribute m_attributes; // Partition attributes (see RmsAttributes).
  89. SHORT m_sizeofIdentifier; // The size of the on-media identifier.
  90. UCHAR m_pIdentifier[MaxId]; // The on-media identifier.
  91. };
  92. #endif // _RMSPARTN_