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.

255 lines
9.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // vsmgmt.idl - Interfaces for Snapshots management exposed by VSS and/or providers
  4. //
  5. // Copyright (c) 2000 Microsoft Corporation
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////
  8. // Imports
  9. //
  10. import "oaidl.idl";
  11. import "ocidl.idl";
  12. import "vss.idl";
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // Constants
  15. //
  16. // Types of returned objects in a Query
  17. typedef enum _VSS_MGMT_OBJECT_TYPE {
  18. VSS_MGMT_OBJECT_UNKNOWN = 0,
  19. VSS_MGMT_OBJECT_VOLUME, // Refers to a volume to be snapshotted
  20. VSS_MGMT_OBJECT_DIFF_VOLUME, // Refers to a volume to hold a diff area
  21. VSS_MGMT_OBJECT_DIFF_AREA, // Refers to an association between the two objects above.
  22. } VSS_MGMT_OBJECT_TYPE;
  23. // Denotes that no maximum space is specified in AddDiffArea or ChangeDiffAreaMaximumSize
  24. const LONGLONG VSS_ASSOC_NO_MAX_SPACE = -1;
  25. // If this constant is specified in ChangeDiffAreaMaximumSize then the association is removed
  26. const LONGLONG VSS_ASSOC_REMOVE = 0;
  27. ///////////////////////////////////////////////////////////////////////////////
  28. // Typedefs and structures
  29. //
  30. // Structure containing the properties of a volume as being a volume to be snapshotted.
  31. typedef struct _VSS_VOLUME_PROP {
  32. VSS_PWSZ m_pwszVolumeName; // The volume name, in \\?\Volume{GUID} format.
  33. VSS_PWSZ m_pwszVolumeDisplayName; // The shortest mount point (for example C:\)
  34. } VSS_VOLUME_PROP, *PVSS_VOLUME_PROP;
  35. // Structure containing the properties of a volume that can be used to keep a diff area
  36. typedef struct _VSS_DIFF_VOLUME_PROP {
  37. VSS_PWSZ m_pwszVolumeName; // The volume name, in \\?\Volume{GUID} format.
  38. VSS_PWSZ m_pwszVolumeDisplayName; // Represents the shortest mount point (for example C:\)
  39. LONGLONG m_llVolumeFreeSpace; // Free space on that volume
  40. LONGLONG m_llVolumeTotalSpace; // Total space on that volume
  41. } VSS_DIFF_VOLUME_PROP, *PVSS_DIFF_VOLUME_PROP;
  42. // Structure containing the properties of a diff area association between
  43. // a volume to be snapshotted and a diff volume.
  44. typedef struct _VSS_DIFF_AREA_PROP {
  45. VSS_PWSZ m_pwszVolumeName; // The original volume name
  46. VSS_PWSZ m_pwszDiffAreaVolumeName; // The diff area volume name
  47. LONGLONG m_llMaximumDiffSpace; // Maximum space that on the diff area volume in this association.
  48. LONGLONG m_llAllocatedDiffSpace; // Allocated space on the diff area volume by this association.
  49. LONGLONG m_llUsedDiffSpace; // Used space from the allocated area above.
  50. } VSS_DIFF_AREA_PROP, *PVSS_DIFF_AREA_PROP;
  51. // General-purpose union containing the properties of a volume or diff area
  52. [ switch_type(VSS_MGMT_OBJECT_TYPE) ]
  53. typedef union {
  54. [case(VSS_MGMT_OBJECT_VOLUME)] VSS_VOLUME_PROP Vol;
  55. [case(VSS_MGMT_OBJECT_DIFF_VOLUME)] VSS_DIFF_VOLUME_PROP DiffVol;
  56. [case(VSS_MGMT_OBJECT_DIFF_AREA)] VSS_DIFF_AREA_PROP DiffArea;
  57. [default];
  58. } VSS_MGMT_OBJECT_UNION;
  59. typedef struct _VSS_MGMT_OBJECT_PROP {
  60. VSS_MGMT_OBJECT_TYPE Type;
  61. [ switch_is(Type) ] VSS_MGMT_OBJECT_UNION Obj;
  62. } VSS_MGMT_OBJECT_PROP, *PVSS_MGMT_OBJECT_PROP;
  63. ///////////////////////////////////////////////////////////////////////////////
  64. // Forward declarations
  65. //
  66. interface IVssSnapshotMgmt;
  67. interface IVssDifferentialSoftwareSnapshotMgmt;
  68. interface IVssEnumMgmtObject;
  69. ///////////////////////////////////////////////////////////////////////////////
  70. // Interfaces
  71. //
  72. // Used to manage diff areas remotely for Software-based snapshots (using hte copy-on-write mechanism).
  73. // Implemented by VSS and each provider.
  74. [
  75. object,
  76. uuid(FA7DF749-66E7-4986-A27F-E2F04AE53772),
  77. helpstring("IVssSnapshotMgmt interface"),
  78. pointer_default(unique)
  79. ]
  80. interface IVssSnapshotMgmt: IUnknown
  81. {
  82. // Returns an interface to further configure a snapshot provider
  83. HRESULT GetProviderMgmtInterface(
  84. [in] VSS_ID ProviderId, // It might be a software or a system provider.
  85. [in] REFIID InterfaceId, // Might be IID_IVssDifferentialSoftwareSnapshotMgmt
  86. [out, iid_is(InterfaceId)]
  87. IUnknown** ppItf
  88. );
  89. //
  90. // Queries
  91. //
  92. // Query volumes that support snapshots
  93. HRESULT QueryVolumesSupportedForSnapshots(
  94. [in] VSS_ID ProviderId,
  95. [in] LONG lContext,
  96. [out] IVssEnumMgmtObject **ppEnum
  97. );
  98. // Query snapshots on the given volume.
  99. HRESULT QuerySnapshotsByVolume(
  100. [in] VSS_PWSZ pwszVolumeName,
  101. [in] VSS_ID ProviderId,
  102. [out] IVssEnumObject **ppEnum
  103. );
  104. };
  105. // Used to manage diff areas remotely for Software-based
  106. // snapshots (using the copy-on-write mechanism).
  107. // This is implemented by a Snapshot/System provider and
  108. // returned by IVssSnapshotMgmt::GetProviderMgmtInterface
  109. [
  110. object,
  111. uuid(214A0F28-B737-4026-B847-4F9E37D79529),
  112. helpstring("IVssDifferentialSoftwareSnapshotMgmt interface"),
  113. pointer_default(unique)
  114. ]
  115. interface IVssDifferentialSoftwareSnapshotMgmt: IUnknown
  116. {
  117. //
  118. // Diff area management
  119. //
  120. // Adds a diff area association for a certain volume.
  121. // If the association is not supported, an error code will be returned.
  122. HRESULT AddDiffArea(
  123. [in] VSS_PWSZ pwszVolumeName,
  124. [in] VSS_PWSZ pwszDiffAreaVolumeName,
  125. [in] LONGLONG llMaximumDiffSpace
  126. );
  127. // Updates the diff area max size for a certain volume.
  128. // This may not have an immediate effect
  129. // note that setting llMaximumDiffSpace to 0 will disable the
  130. // diff area
  131. HRESULT ChangeDiffAreaMaximumSize(
  132. [in] VSS_PWSZ pwszVolumeName,
  133. [in] VSS_PWSZ pwszDiffAreaVolumeName,
  134. [in] LONGLONG llMaximumDiffSpace
  135. );
  136. //
  137. // Queries
  138. //
  139. // Query volumes that support diff areas (including the disabled ones)
  140. HRESULT QueryVolumesSupportedForDiffAreas(
  141. [in] VSS_PWSZ pwszOriginalVolumeName,
  142. [out] IVssEnumMgmtObject **ppEnum
  143. );
  144. // Query diff areas that host snapshots on the given (snapshotted) volume
  145. HRESULT QueryDiffAreasForVolume(
  146. [in] VSS_PWSZ pwszVolumeName,
  147. [out] IVssEnumMgmtObject **ppEnum
  148. );
  149. // Query diff areas that physically reside on the given volume
  150. HRESULT QueryDiffAreasOnVolume(
  151. [in] VSS_PWSZ pwszVolumeName,
  152. [out] IVssEnumMgmtObject **ppEnum
  153. );
  154. // Query diff areas in use by the given snapshot
  155. HRESULT QueryDiffAreasForSnapshot(
  156. [in] VSS_ID SnapshotId,
  157. [out] IVssEnumMgmtObject **ppEnum
  158. );
  159. };
  160. // This returns a set of volumes that can be snapshotted by Babbage. Returned by Query.
  161. [
  162. object,
  163. uuid(01954E6B-9254-4e6e-808C-C9E05D007696),
  164. helpstring("IVssEnumMgmtObject Interface"),
  165. pointer_default(unique)
  166. ]
  167. interface IVssEnumMgmtObject : IUnknown
  168. {
  169. HRESULT Next(
  170. [in] ULONG celt,
  171. [out, size_is(celt), length_is(*pceltFetched)]
  172. VSS_MGMT_OBJECT_PROP *rgelt,
  173. [out] ULONG *pceltFetched
  174. );
  175. HRESULT Skip(
  176. [in] ULONG celt
  177. );
  178. HRESULT Reset();
  179. HRESULT Clone(
  180. [in, out] IVssEnumMgmtObject **ppenum
  181. );
  182. };
  183. ////////////////////////////////////////////////////////////////////////////////
  184. // Snapshot Mgmt Type Library
  185. //
  186. [
  187. uuid(84015C41-291D-49e6-BF7F-DD40AE93632B),
  188. version(1.0),
  189. helpstring("Shadow Copy Mgmt 1.0 Type Library")
  190. ]
  191. library VSMGMT
  192. {
  193. importlib("stdole2.tlb");
  194. [
  195. uuid(0B5A2C52-3EB9-470a-96E2-6C6D4570E40F),
  196. helpstring("VssSnapshotMgmt Class")
  197. ]
  198. coclass VssSnapshotMgmt
  199. {
  200. [default] interface IVssSnapshotMgmt;
  201. }
  202. }