Source code of Windows XP (NT5)
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.

204 lines
7.1 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. RmsLibry.h
  5. Abstract:
  6. Declaration of the CRmsLibrary class
  7. Author:
  8. Brian Dodd [brian] 15-Nov-1996
  9. Revision History:
  10. --*/
  11. #ifndef _RMSLIBRY_
  12. #define _RMSLIBRY_
  13. #include "resource.h" // resource symbols
  14. #include "RmsObjct.h" // CRmsComObject
  15. /*++
  16. Class Name:
  17. CRmsLibrary
  18. Class Description:
  19. A CRmsLibrary represents the multi-device complex that includes:
  20. zero or more medium changers,
  21. zero or more drive classes,
  22. zero or more drives,
  23. zero or more storage slots,
  24. zero or more staging slots,
  25. zero or more I/E ports,
  26. zero or more cleaning cartridges,
  27. zero or more scratch cartridges,
  28. zero or more media sets.
  29. But, at least one.
  30. --*/
  31. class CRmsLibrary :
  32. public CComDualImpl<IRmsLibrary, &IID_IRmsLibrary, &LIBID_RMSLib>,
  33. public CRmsComObject,
  34. public CWsbObject, // inherits CComObjectRoot
  35. public CComCoClass<CRmsLibrary,&CLSID_CRmsLibrary>
  36. {
  37. public:
  38. CRmsLibrary() {}
  39. BEGIN_COM_MAP(CRmsLibrary)
  40. COM_INTERFACE_ENTRY2(IDispatch, IRmsLibrary)
  41. COM_INTERFACE_ENTRY(IRmsLibrary)
  42. COM_INTERFACE_ENTRY(IRmsComObject)
  43. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  44. COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
  45. COM_INTERFACE_ENTRY(IPersistStream)
  46. COM_INTERFACE_ENTRY(IWsbCollectable)
  47. COM_INTERFACE_ENTRY(IWsbPersistStream)
  48. COM_INTERFACE_ENTRY(IWsbTestable)
  49. END_COM_MAP()
  50. DECLARE_REGISTRY_RESOURCEID(IDR_RmsLibrary)
  51. // CComObjectRoot
  52. public:
  53. STDMETHOD(FinalConstruct)(void);
  54. // IPersist
  55. public:
  56. STDMETHOD(GetClassID)(CLSID *pClsid);
  57. // IPersistStream
  58. public:
  59. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  60. STDMETHOD(Load)(IStream* pStream);
  61. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  62. // IWsbCollectable
  63. public:
  64. STDMETHOD(CompareTo)(IUnknown* pCollectable, SHORT* pResult);
  65. WSB_FROM_CWSBOBJECT;
  66. // IWsbTestable
  67. public:
  68. STDMETHOD(Test)(USHORT *pPassed, USHORT *pFailed);
  69. // IRmsLibrary
  70. public:
  71. STDMETHOD(GetLibraryId)(GUID *pLibraryId);
  72. STDMETHOD(SetLibraryId)(GUID libraryId);
  73. STDMETHOD( GetName )( BSTR *pName );
  74. STDMETHOD( SetName )( BSTR name );
  75. STDMETHOD(GetMediaSupported)(LONG *pType);
  76. STDMETHOD(SetMediaSupported)(LONG type);
  77. STDMETHOD(GetMaxChangers)(LONG *pNum);
  78. STDMETHOD(SetMaxChangers)(LONG num);
  79. STDMETHOD(GetMaxDrives)(LONG *pNum);
  80. STDMETHOD(SetMaxDrives)(LONG num);
  81. STDMETHOD(GetMaxPorts)(LONG *pNum);
  82. STDMETHOD(SetMaxPorts)(LONG num);
  83. STDMETHOD(GetMaxSlots)(LONG *pNum);
  84. STDMETHOD(SetMaxSlots)(LONG num);
  85. STDMETHOD(GetNumUsedSlots)(LONG *pNum);
  86. STDMETHOD(GetNumStagingSlots)(LONG *pNum);
  87. STDMETHOD(SetNumStagingSlots)(LONG num);
  88. STDMETHOD(GetNumScratchCarts)(LONG *pNum);
  89. STDMETHOD(SetNumScratchCarts)(LONG num);
  90. STDMETHOD(GetNumUnknownCarts)(LONG *pNum);
  91. STDMETHOD(SetNumUnknownCarts)(LONG num);
  92. STDMETHOD(SetIsMagazineSupported)(BOOL flag);
  93. STDMETHOD(IsMagazineSupported)(void);
  94. STDMETHOD(GetMaxCleaningMounts)(LONG *pNum);
  95. STDMETHOD(SetMaxCleaningMounts)(LONG num);
  96. STDMETHOD(GetSlotSelectionPolicy)(LONG *pNum);
  97. STDMETHOD(SetSlotSelectionPolicy)(LONG num);
  98. STDMETHOD(GetChangers)(IWsbIndexedCollection **ptr);
  99. STDMETHOD(GetDriveClasses)(IWsbIndexedCollection **ptr);
  100. STDMETHOD(GetDrives)(IWsbIndexedCollection **ptr);
  101. STDMETHOD(GetStorageSlots)(IWsbIndexedCollection **ptr);
  102. STDMETHOD(GetStagingSlots)(IWsbIndexedCollection **ptr);
  103. STDMETHOD(GetPorts)(IWsbIndexedCollection **ptr);
  104. STDMETHOD(GetCleaningCartridges)(IWsbIndexedCollection **ptr);
  105. STDMETHOD(GetScratchCartridges)(IWsbIndexedCollection **ptr);
  106. STDMETHOD(GetMediaSets)(IWsbIndexedCollection **ptr);
  107. STDMETHOD( Audit )( LONG start, LONG count, BOOL verify, BOOL unknownOnly, BOOL mountWait, LPOVERLAPPED pOverlapped, LONG *pRequest );
  108. protected:
  109. enum { // Class specific constants:
  110. //
  111. Version = 1, // Class version, this should be
  112. // incremented each time the
  113. // the class definition changes.
  114. }; //
  115. RmsMedia m_mediaSupported; // The type of media supported by a
  116. // a Drive, usually one type, but
  117. // can be a combination of media
  118. // types for multi-function devices
  119. // (i.e. drives that support Optical,
  120. // WORM, and CDR).
  121. LONG m_maxChangers; // The total number of medium changers contained
  122. // within the Library.
  123. LONG m_maxDrives; // The total number of drives contained
  124. // within the Library.
  125. LONG m_maxPorts; // The total number of I/E ports contained
  126. // within the Library.
  127. LONG m_maxSlots; // The total number of storage slots
  128. // contained within the library.
  129. LONG m_NumUsedSlots; // The number of occupied storage slots.
  130. LONG m_NumStagingSlots; // The number of slots used for staging area.
  131. LONG m_NumScratchCarts; // The amount of scratch media available.
  132. LONG m_NumUnknownCarts; // The number of units of media
  133. // having unknown status.
  134. BOOL m_isMagazineSupported; // If TRUE, the library supports magazines.
  135. LONG m_maxCleaningMounts; // The max number of mounts per cleaning
  136. // cartridge.
  137. RmsSlotSelect m_slotSelectionPolicy; // The storage slot selection policy
  138. // to use (see RmsSlotSelect).
  139. CComPtr<IWsbIndexedCollection> m_pChangers; // The changers associates with the Library.
  140. CComPtr<IWsbIndexedCollection> m_pDriveClasses; // The drive classes associates with the Library.
  141. CComPtr<IWsbIndexedCollection> m_pDrives; // The drives associates with the Library.
  142. CComPtr<IWsbIndexedCollection> m_pStorageSlots; // The storage slots associates with the Library.
  143. CComPtr<IWsbIndexedCollection> m_pStagingSlots; // The staging slots associates with the Library.
  144. CComPtr<IWsbIndexedCollection> m_pPorts; // The I/E ports associated with the Library.
  145. CComPtr<IWsbIndexedCollection> m_pCleaningCartridges; // The cleaning cartridges associated with the Library.
  146. CComPtr<IWsbIndexedCollection> m_pScratchCartridges; // The scratch cartridges associated with the Library.
  147. CComPtr<IWsbIndexedCollection> m_pMediaSets; // The media sets associated with the Library.
  148. };
  149. #endif // _RMSLIBRY_