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.

275 lines
5.8 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. RsAdUtil.h
  5. Abstract:
  6. Utility functions for GUI - for us in HSMADMIN files only
  7. Author:
  8. Art Bragg [abragg] 04-Mar-1997
  9. Revision History:
  10. --*/
  11. // Defined constants for media copy states
  12. #define RS_MEDIA_COPY_STATUS_NONE ((USHORT)5000)
  13. #define RS_MEDIA_COPY_STATUS_ERROR ((USHORT)5001)
  14. #define RS_MEDIA_COPY_STATUS_OUTSYNC ((USHORT)5002)
  15. #define RS_MEDIA_COPY_STATUS_INSYNC ((USHORT)5003)
  16. #define RS_MEDIA_COPY_STATUS_MISSING ((USHORT)5004)
  17. // Defined constants for master media states
  18. #define RS_MEDIA_STATUS_RECREATE ((USHORT)5101)
  19. #define RS_MEDIA_STATUS_READONLY ((USHORT)5102)
  20. #define RS_MEDIA_STATUS_NORMAL ((USHORT)5103)
  21. #define RS_MEDIA_STATUS_ERROR_RO ((USHORT)5104)
  22. #define RS_MEDIA_STATUS_ERROR_RW ((USHORT)5105)
  23. #define RS_MEDIA_STATUS_ERROR_MISSING ((USHORT)5106)
  24. #define RS_MEDIA_STATUS_ERROR_INCOMPLETE ((USHORT)5107)
  25. void
  26. RsReportError( HRESULT hrToReport, int textId, ... );
  27. HRESULT RsGetStatusString (
  28. DWORD serviceStatus,
  29. HRESULT hrSetup,
  30. CString& sStatus
  31. );
  32. WCHAR *
  33. RsNotifyEventAsString (
  34. IN MMC_NOTIFY_TYPE event
  35. );
  36. WCHAR *
  37. RsClipFormatAsString (
  38. IN CLIPFORMAT cf
  39. );
  40. HRESULT
  41. RsIsRemoteStorageSetup(
  42. void
  43. );
  44. HRESULT
  45. RsIsRemoteStorageSetupEx(
  46. IHsmServer * pHsmServer
  47. );
  48. HRESULT
  49. RsIsSupportedMediaAvailable(
  50. void
  51. );
  52. HRESULT
  53. RsIsRmsErrorNotReady(
  54. HRESULT HrError
  55. );
  56. USHORT
  57. RsGetCopyStatus(
  58. IN REFGUID CopyId,
  59. IN HRESULT CopyHr,
  60. IN SHORT CopyNextDataSet,
  61. IN SHORT LastGoodNextDataSet
  62. );
  63. HRESULT
  64. RsGetCopyStatusStringVerb(
  65. IN USHORT copyStatus,
  66. OUT CString& String
  67. );
  68. HRESULT
  69. RsGetCopyStatusString(
  70. IN USHORT copyStatus,
  71. OUT CString& String
  72. );
  73. USHORT
  74. RsGetCartStatus(
  75. IN HRESULT LastHr,
  76. IN BOOL ReadOnly,
  77. IN BOOL Recreate,
  78. IN SHORT NextDataSet,
  79. IN SHORT LastGoodNextDataSet
  80. );
  81. HRESULT
  82. RsGetCartStatusString(
  83. IN USHORT cartStatus,
  84. OUT CString& String
  85. );
  86. HRESULT
  87. RsGetCartStatusStringVerb(
  88. IN USHORT cartStatus,
  89. IN BOOL plural,
  90. OUT CString& String
  91. );
  92. HRESULT
  93. RsGetCartMultiStatusString(
  94. IN USHORT statusRecreate,
  95. IN USHORT statusReadOnly,
  96. IN USHORT statusNormal,
  97. IN USHORT statusRO,
  98. IN USHORT statusRW,
  99. IN USHORT statusMissing,
  100. OUT CString &outString
  101. );
  102. HRESULT
  103. RsGetCopyMultiStatusString(
  104. IN USHORT statusNone,
  105. IN USHORT statusError,
  106. IN USHORT statusOutSync,
  107. IN USHORT statusInSync,
  108. OUT CString &outString
  109. );
  110. HRESULT
  111. RsCreateAndRunFsaJob(
  112. IN HSM_JOB_DEF_TYPE jobType,
  113. IN IHsmServer *pHsmServer,
  114. IN IFsaResource *pFsaResource,
  115. IN BOOL ShowMsg = TRUE
  116. );
  117. HRESULT
  118. RsCreateAndRunDirectFsaJob(
  119. IN HSM_JOB_DEF_TYPE jobType,
  120. IN IHsmServer *pHsmServer,
  121. IN IFsaResource *pFsaResource,
  122. IN BOOL waitJob
  123. );
  124. HRESULT
  125. RsCancelDirectFsaJob(
  126. IN HSM_JOB_DEF_TYPE jobType,
  127. IN IHsmServer *pHsmServer,
  128. IN IFsaResource *pFsaResource
  129. );
  130. HRESULT
  131. RsCreateJobName(
  132. IN HSM_JOB_DEF_TYPE jobType,
  133. IN IFsaResource * pResource,
  134. OUT CString& szJobName
  135. );
  136. HRESULT
  137. RsGetJobTypeString(
  138. IN HSM_JOB_DEF_TYPE jobType,
  139. OUT CString& szJobType
  140. );
  141. HRESULT
  142. RsCreateAndRunMediaCopyJob(
  143. IN IHsmServer * pHsmServer,
  144. IN UINT SetNum,
  145. IN BOOL ShowMsg
  146. );
  147. HRESULT
  148. RsCreateAndRunMediaRecreateJob(
  149. IN IHsmServer * pHsmServer,
  150. IN IMediaInfo * pMediaInfo,
  151. IN REFGUID MediaId,
  152. IN CString & MediaDescription,
  153. IN SHORT CopyToUse
  154. );
  155. HRESULT
  156. RsGetStoragePoolId(
  157. IN IHsmServer *pHsmServer,
  158. OUT GUID * pStoragePoolId
  159. );
  160. HRESULT
  161. RsGetStoragePool(
  162. IN IHsmServer * pHsmServer,
  163. OUT IHsmStoragePool ** ppStoragePool
  164. );
  165. HRESULT
  166. RsGetInitialLVColumnProps(
  167. int IdWidths,
  168. int IdTitles,
  169. CString **pColumnWidths,
  170. CString **pColumnTitles,
  171. int *pColumnCount
  172. );
  173. HRESULT
  174. RsServerSaveAll(
  175. IUnknown * pUnkServer
  176. );
  177. HRESULT
  178. RsGetVolumeDisplayName(
  179. IFsaResource * pResource,
  180. CString & DisplayName
  181. );
  182. HRESULT
  183. RsGetVolumeDisplayName2(
  184. IFsaResource * pResource,
  185. CString & DisplayName
  186. );
  187. HRESULT
  188. RsGetVolumeSortKey(
  189. IFsaResource * pResource,
  190. CString & DisplayName
  191. );
  192. HRESULT
  193. RsIsVolumeAvailable(
  194. IFsaResource * pResource
  195. );
  196. HRESULT
  197. RsIsWhiteOnBlack(
  198. );
  199. class CCopySetInfo {
  200. public:
  201. SHORT m_NextDataSet;
  202. FILETIME m_ModifyTime;
  203. HRESULT m_Hr;
  204. GUID m_RmsId;
  205. BOOL m_Disabled;
  206. };
  207. class CResourceInfo {
  208. public:
  209. CResourceInfo( IFsaResource* pResource ) {
  210. m_pResource = pResource;
  211. m_HrConstruct = RsGetVolumeDisplayName( m_pResource, m_DisplayName );
  212. if( SUCCEEDED( m_HrConstruct ) ) {
  213. m_HrConstruct = RsGetVolumeSortKey( m_pResource, m_SortKey );
  214. }
  215. };
  216. static INT CALLBACK Compare( LPARAM lParam1, LPARAM lParam2, LPARAM /* lParamSort */ ) {
  217. CResourceInfo* pResInfo1 = (CResourceInfo*)lParam1;
  218. CResourceInfo* pResInfo2 = (CResourceInfo*)lParam2;
  219. if( ! pResInfo1 ) return( -1 );
  220. if( ! pResInfo2 ) return( 1 );
  221. return( pResInfo1->m_SortKey.CompareNoCase( pResInfo2->m_SortKey ) );
  222. }
  223. CString m_DisplayName;
  224. CString m_SortKey;
  225. CComPtr<IFsaResource> m_pResource;
  226. HRESULT m_HrConstruct;
  227. };