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.

160 lines
5.0 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsMdSet.h
  5. Abstract:
  6. Declaration of the CRmsMediaSet class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSMDSET_
  12. #define _RMSMDSET_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. #include "RmsSInfo.h" // CRmsStorageInfo
  16. /*++
  17. Class Name:
  18. CRmsMediaSet
  19. Class Description:
  20. A CRmsMediaSet is a logical repository for Cartridges.
  21. --*/
  22. class CRmsMediaSet :
  23. public CComDualImpl<IRmsMediaSet, &IID_IRmsMediaSet, &LIBID_RMSLib>,
  24. public CRmsStorageInfo, // inherits CRmsComObject
  25. public CWsbObject, // inherits CComObjectRoot
  26. public CComCoClass<CRmsMediaSet,&CLSID_CRmsMediaSet>
  27. {
  28. public:
  29. CRmsMediaSet() {}
  30. BEGIN_COM_MAP(CRmsMediaSet)
  31. COM_INTERFACE_ENTRY2(IDispatch, IRmsMediaSet)
  32. COM_INTERFACE_ENTRY(IRmsMediaSet)
  33. COM_INTERFACE_ENTRY(IRmsComObject)
  34. COM_INTERFACE_ENTRY(IRmsStorageInfo)
  35. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  36. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  37. COM_INTERFACE_ENTRY(IPersistStream)
  38. COM_INTERFACE_ENTRY(IWsbCollectable)
  39. // COM_INTERFACE_ENTRY(IWsbPersistable)
  40. COM_INTERFACE_ENTRY(IWsbTestable)
  41. END_COM_MAP()
  42. DECLARE_REGISTRY_RESOURCEID(IDR_RmsMediaSet)
  43. // CComObjectRoot
  44. public:
  45. STDMETHOD(FinalConstruct)(void);
  46. // IPersist
  47. public:
  48. STDMETHOD(GetClassID)(CLSID *pClsid);
  49. // IPersistStream
  50. public:
  51. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  52. STDMETHOD(Load)(IStream* pStream);
  53. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  54. // IWsbCollectable
  55. public:
  56. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  57. WSB_FROM_CWSBOBJECT;
  58. // IWsbTestable
  59. public:
  60. STDMETHOD(Test)(USHORT *pPassed, USHORT *pFailed);
  61. // IRmsMediaSet
  62. public:
  63. STDMETHOD(GetMediaSetId)(GUID *pMediaSetId);
  64. STDMETHOD(GetName)(BSTR *pName);
  65. STDMETHOD(SetName)(BSTR name);
  66. STDMETHOD(GetMediaSupported)(LONG *pType);
  67. STDMETHOD(SetMediaSupported)(LONG type);
  68. STDMETHOD(GetInfo)(UCHAR *pInfo, SHORT *pSize);
  69. STDMETHOD(SetInfo)(UCHAR *pInfo, SHORT size);
  70. STDMETHOD(GetOwnerClassId)(CLSID *pClassId);
  71. STDMETHOD(SetOwnerClassId)(CLSID classId);
  72. STDMETHOD(GetMediaSetType)(LONG *pType);
  73. STDMETHOD(SetMediaSetType)(LONG type);
  74. STDMETHOD(GetMaxCartridges)(LONG *pNum);
  75. STDMETHOD(SetMaxCartridges)(LONG num);
  76. STDMETHOD(GetOccupancy)(LONG *pNum);
  77. STDMETHOD(SetOccupancy)(LONG num);
  78. STDMETHOD(IsMediaCopySupported)();
  79. STDMETHOD(SetIsMediaCopySupported)(BOOL flag);
  80. STDMETHOD(Allocate)(
  81. IN REFGUID prevSideId,
  82. IN OUT LONGLONG *pFreeSpace,
  83. IN BSTR displayName,
  84. IN DWORD dwOptions,
  85. OUT IRmsCartridge **ppCart);
  86. STDMETHOD(Deallocate)(
  87. IN IRmsCartridge *pCart);
  88. ////////////////////////////////////////////////////////////////////////////////////////
  89. //
  90. // data members
  91. //
  92. private:
  93. enum { // Class specific constants:
  94. //
  95. Version = 1, // Class version, this should be
  96. // incremented each time the
  97. // the class definition changes.
  98. MaxInfo = 128, // Size of the application specific
  99. // infomation buffer. Currently
  100. // fixed in size.
  101. }; //
  102. RmsMedia m_MediaSupported; // supported media format(s) for this media set.
  103. // One or more types are permissible, but
  104. // not all combinations are sensical.
  105. SHORT m_SizeOfInfo; // The size of valid data in the application
  106. // specific information buffer.
  107. UCHAR m_Info[MaxInfo]; // Application specific information.
  108. CLSID m_OwnerId; // the registered Class ID of the
  109. // application that owns/created the
  110. // MediaSet.
  111. RmsMediaSet m_MediaSetType; // the type of MediaSet.
  112. LONG m_MaxCartridges; // max number of Cartridges allowed in the
  113. // MediaSet.
  114. LONG m_Occupancy; // number of Cartridges presently in the
  115. // MediaSet.
  116. BOOL m_IsMediaCopySupported; // TRUE, if the media in the MediaSet can be
  117. // copied. This requires simultaneous
  118. // access to two drives.
  119. };
  120. #endif // _RMSMDSET_