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.

567 lines
13 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////
  6. // Imports
  7. //
  8. import "oaidl.idl";
  9. import "ocidl.idl";
  10. ///////////////////////////////////////////////////////////////////////////////
  11. // Forward declarations
  12. //
  13. interface IVssEnumObject;
  14. // interfaces supported by the provider
  15. interface IVssSnapshot;
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // Constants and enums
  18. //
  19. typedef enum _VSS_OBJECT_TYPE {
  20. VSS_OBJECT_UNKNOWN = 0,
  21. VSS_OBJECT_NONE,
  22. VSS_OBJECT_SNAPSHOT_SET,
  23. VSS_OBJECT_SNAPSHOT,
  24. VSS_OBJECT_PROVIDER,
  25. VSS_OBJECT_TYPE_COUNT
  26. } VSS_OBJECT_TYPE, *PVSS_OBJECT_TYPE;
  27. typedef enum _VSS_SNAPSHOT_STATE {
  28. VSS_SS_UNKNOWN = 0,
  29. VSS_SS_PREPARING,
  30. VSS_SS_PROCESSING_PREPARE,
  31. VSS_SS_PREPARED,
  32. VSS_SS_PROCESSING_PRECOMMIT,
  33. VSS_SS_PRECOMMITTED,
  34. VSS_SS_PROCESSING_COMMIT,
  35. VSS_SS_COMMITTED,
  36. VSS_SS_PROCESSING_POSTCOMMIT,
  37. VSS_SS_CREATED,
  38. VSS_SS_ABORTED,
  39. VSS_SS_DELETED,
  40. VSS_SS_COUNT
  41. } VSS_SNAPSHOT_STATE, *PVSS_SNAPSHOT_STATE;
  42. enum _VSS_VOLUME_SNAPSHOT_ATTRIBUTES {
  43. VSS_VOLSNAP_ATTR_PERSISTENT = 0x00000001,
  44. VSS_VOLSNAP_ATTR_READ_WRITE = 0x00000002,
  45. VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE = 0x00000004,
  46. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE = 0x00000008,
  47. VSS_VOLSNAP_ATTR_NO_WRITERS = 0x00000010,
  48. VSS_VOLSNAP_ATTR_TRANSPORTABLE = 0x00000020,
  49. VSS_VOLSNAP_ATTR_NOT_SURFACED = 0x00000040,
  50. VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED = 0x00010000,
  51. VSS_VOLSNAP_ATTR_DIFFERENTIAL = 0x00020000,
  52. VSS_VOLSNAP_ATTR_PLEX = 0x00040000,
  53. VSS_VOLSNAP_ATTR_IMPORTED = 0x00080000,
  54. VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY = 0x00100000,
  55. VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY = 0x00200000,
  56. };
  57. enum _VSS_SNAPSHOT_CONTEXT {
  58. VSS_CTX_BACKUP = 0x00000000,
  59. VSS_CTX_FILE_SHARE_BACKUP = VSS_VOLSNAP_ATTR_NO_WRITERS,
  60. VSS_CTX_NAS_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT |
  61. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE |
  62. VSS_VOLSNAP_ATTR_NO_WRITERS,
  63. VSS_CTX_APP_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT |
  64. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE,
  65. VSS_CTX_CLIENT_ACCESSIBLE = VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE |
  66. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE |
  67. VSS_VOLSNAP_ATTR_NO_WRITERS,
  68. VSS_CTX_PERSISTENT_CLIENT_ACCESSIBLE = VSS_VOLSNAP_ATTR_PERSISTENT |
  69. VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE |
  70. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE |
  71. VSS_VOLSNAP_ATTR_NO_WRITERS,
  72. VSS_CTX_ALL = 0xFFFFFFFF,
  73. };
  74. typedef enum _VSS_WRITER_STATE {
  75. VSS_WS_UNKNOWN = 0,
  76. VSS_WS_STABLE,
  77. VSS_WS_WAITING_FOR_FREEZE,
  78. VSS_WS_WAITING_FOR_THAW,
  79. VSS_WS_WAITING_FOR_POST_SNAPSHOT,
  80. VSS_WS_WAITING_FOR_BACKUP_COMPLETE,
  81. VSS_WS_FAILED_AT_IDENTIFY,
  82. VSS_WS_FAILED_AT_PREPARE_BACKUP,
  83. VSS_WS_FAILED_AT_PREPARE_SNAPSHOT,
  84. VSS_WS_FAILED_AT_FREEZE,
  85. VSS_WS_FAILED_AT_THAW,
  86. VSS_WS_FAILED_AT_POST_SNAPSHOT,
  87. VSS_WS_FAILED_AT_BACKUP_COMPLETE,
  88. VSS_WS_FAILED_AT_PRE_RESTORE,
  89. VSS_WS_FAILED_AT_POST_RESTORE,
  90. VSS_WS_COUNT
  91. } VSS_WRITER_STATE, *PVSS_WRITER_STATE;
  92. typedef enum _VSS_BACKUP_TYPE {
  93. VSS_BT_UNDEFINED,
  94. VSS_BT_FULL,
  95. VSS_BT_INCREMENTAL,
  96. VSS_BT_DIFFERENTIAL,
  97. VSS_BT_LOG,
  98. VSS_BT_OTHER
  99. } VSS_BACKUP_TYPE;
  100. typedef enum _VSS_PROVIDER_TYPE
  101. {
  102. VSS_PROV_UNKNOWN = 0,
  103. VSS_PROV_SYSTEM = 1,
  104. VSS_PROV_SOFTWARE = 2,
  105. VSS_PROV_HARDWARE = 3,
  106. } VSS_PROVIDER_TYPE, *PVSS_PROVIDER_TYPE;
  107. typedef enum _VSS_APPLICATION_LEVEL
  108. {
  109. VSS_APP_UNKNOWN = 0,
  110. VSS_APP_SYSTEM = 1,
  111. VSS_APP_BACK_END = 2,
  112. VSS_APP_FRONT_END = 3,
  113. VSS_APP_AUTO = -1,
  114. } VSS_APPLICATION_LEVEL, *PVSS_APPLICATION_LEVEL;
  115. // mask containing flags indicating what
  116. typedef enum _VSS_SNAPSHOT_COMPATIBILITY
  117. {
  118. VSS_SC_DISABLE_DEFRAG = 0x1,
  119. VSS_SC_DISABLE_CONTENTINDEX = 0x2
  120. } VSS_SNAPSHOT_COMPATIBILITY;
  121. typedef enum _VSS_SNAPSHOT_PROPERTY_ID {
  122. VSS_SPROPID_UNKNOWN = 0x0000000,
  123. VSS_SPROPID_SNAPSHOT_ID = 0x0000001,
  124. VSS_SPROPID_SNAPSHOT_SET_ID = 0x0000002,
  125. VSS_SPROPID_SNAPSHOTS_COUNT = 0x0000003,
  126. VSS_SPROPID_SNAPSHOT_DEVICE = 0x0000004,
  127. VSS_SPROPID_ORIGINAL_VOLUME = 0x0000005,
  128. VSS_SPROPID_ORIGINATING_MACHINE = 0x0000006,
  129. VSS_SPROPID_SERVICE_MACHINE = 0x0000007,
  130. VSS_SPROPID_EXPOSED_NAME = 0x0000008,
  131. VSS_SPROPID_EXPOSED_PATH = 0x0000009,
  132. VSS_SPROPID_PROVIDER_ID = 0x000000A,
  133. VSS_SPROPID_SNAPSHOT_ATTRIBUTES = 0x000000B,
  134. VSS_SPROPID_CREATION_TIMESTAMP = 0x000000C,
  135. VSS_SPROPID_STATUS = 0x000000D,
  136. } VSS_SNAPSHOT_PROPERTY_ID, *PVSS_SNAPSHOT_PROPERTY_ID;
  137. ////////////////////////////////////////////////////////
  138. // Typedefs and structures
  139. //
  140. typedef GUID VSS_ID;
  141. typedef [unique, string] WCHAR* VSS_PWSZ;
  142. typedef LONGLONG VSS_TIMESTAMP;
  143. typedef struct _VSS_SNAPSHOT_PROP {
  144. VSS_ID m_SnapshotId;
  145. VSS_ID m_SnapshotSetId;
  146. LONG m_lSnapshotsCount;
  147. VSS_PWSZ m_pwszSnapshotDeviceObject;
  148. VSS_PWSZ m_pwszOriginalVolumeName;
  149. VSS_PWSZ m_pwszOriginatingMachine;
  150. VSS_PWSZ m_pwszServiceMachine;
  151. VSS_PWSZ m_pwszExposedName;
  152. VSS_PWSZ m_pwszExposedPath;
  153. VSS_ID m_ProviderId;
  154. LONG m_lSnapshotAttributes;
  155. VSS_TIMESTAMP m_tsCreationTimestamp;
  156. VSS_SNAPSHOT_STATE m_eStatus;
  157. } VSS_SNAPSHOT_PROP, *PVSS_SNAPSHOT_PROP;
  158. typedef struct _VSS_PROVIDER_PROP {
  159. VSS_ID m_ProviderId;
  160. VSS_PWSZ m_pwszProviderName;
  161. VSS_PROVIDER_TYPE m_eProviderType;
  162. VSS_PWSZ m_pwszProviderVersion;
  163. VSS_ID m_ProviderVersionId;
  164. CLSID m_ClassId;
  165. } VSS_PROVIDER_PROP, *PVSS_PROVIDER_PROP;
  166. [ switch_type(VSS_OBJECT_TYPE) ]
  167. typedef union {
  168. [case(VSS_OBJECT_SNAPSHOT)] VSS_SNAPSHOT_PROP Snap;
  169. [case(VSS_OBJECT_PROVIDER)] VSS_PROVIDER_PROP Prov;
  170. [default];
  171. } VSS_OBJECT_UNION;
  172. typedef struct _VSS_OBJECT_PROP {
  173. VSS_OBJECT_TYPE Type;
  174. [ switch_is(Type) ] VSS_OBJECT_UNION Obj;
  175. } VSS_OBJECT_PROP, *PVSS_OBJECT_PROP;
  176. [
  177. object,
  178. uuid(AE1C7110-2F60-11d3-8A39-00C04F72D8E3),
  179. helpstring("IVssEnumObject Interface"),
  180. pointer_default(unique)
  181. ]
  182. interface IVssEnumObject : IUnknown
  183. {
  184. HRESULT Next(
  185. [in] ULONG celt,
  186. [out, size_is(celt), length_is(*pceltFetched)]
  187. VSS_OBJECT_PROP *rgelt,
  188. [out] ULONG *pceltFetched
  189. );
  190. HRESULT Skip(
  191. [in] ULONG celt
  192. );
  193. HRESULT Reset();
  194. HRESULT Clone(
  195. [in, out] IVssEnumObject **ppenum
  196. );
  197. };
  198. [
  199. object,
  200. uuid(C7B98A22-222D-4e62-B875-1A44980634AF),
  201. helpstring("IVssAsync Interface"),
  202. pointer_default(unique)
  203. ]
  204. interface IVssAsync : IUnknown
  205. {
  206. [helpstring("method Cancel")]
  207. HRESULT Cancel();
  208. [helpstring("method Wait")]
  209. HRESULT Wait();
  210. [helpstring("method QueryStatus")]
  211. HRESULT QueryStatus(
  212. [out] HRESULT* pHrResult,
  213. [in, out, unique] INT* pReserved
  214. );
  215. };
  216. /////////////////////////////////////////////////////////////////////////////
  217. // VSS HRESULT errors
  218. //
  219. // MessageId: VSS_E_BAD_STATE
  220. //
  221. // MessageText:
  222. //
  223. // A function call was invalid because of the state of either the
  224. // backup extensions or the coordinator. For example calling AddToSnapshot
  225. // set prior to calling StartSnapshotSet.
  226. //
  227. const HRESULT VSS_E_BAD_STATE = (0x80042301L);
  228. //
  229. // MessageId: VSS_E_PROVIDER_ALREADY_REGISTERED
  230. //
  231. // MessageText:
  232. //
  233. // Calling RegisterProvider
  234. //
  235. const HRESULT VSS_E_PROVIDER_ALREADY_REGISTERED = (0x80042303L);
  236. //
  237. // MessageId: VSS_E_PROVIDER_NOT_REGISTERED
  238. //
  239. // MessageText:
  240. //
  241. // Calling UnregisterProvider
  242. //
  243. const HRESULT VSS_E_PROVIDER_NOT_REGISTERED = (0x80042304L);
  244. //
  245. // MessageId: VSS_E_PROVIDER_VETO
  246. //
  247. // MessageText:
  248. //
  249. // Calling DoSnapshotSet
  250. //
  251. const HRESULT VSS_E_PROVIDER_VETO = (0x80042306L);
  252. //
  253. // MessageId: VSS_E_PROVIDER_IN_USE
  254. //
  255. // MessageText:
  256. //
  257. // Calling UnregisterProvider, StartSnapshotSet
  258. //
  259. const HRESULT VSS_E_PROVIDER_IN_USE = (0x80042307L);
  260. //
  261. // MessageId: VSS_E_OBJECT_NOT_FOUND
  262. //
  263. // MessageText:
  264. //
  265. // Calling DeleteSnapshots, Query
  266. //
  267. const HRESULT VSS_E_OBJECT_NOT_FOUND = (0x80042308L);
  268. //
  269. // MessageId: VSS_S_ASYNC_PENDING
  270. //
  271. // MessageText:
  272. //
  273. // Calling IVssAsync::QueryStatus
  274. //
  275. const HRESULT VSS_S_ASYNC_PENDING = (0x00042309L);
  276. //
  277. // MessageId: VSS_S_ASYNC_FINISHED
  278. //
  279. // MessageText:
  280. //
  281. // Calling IVssAsync::QueryStatus
  282. //
  283. const HRESULT VSS_S_ASYNC_FINISHED = (0x0004230AL);
  284. //
  285. // MessageId: VSS_S_ASYNC_CANCELLED
  286. //
  287. // MessageText:
  288. //
  289. // Calling IVssAsync::QueryStatus
  290. //
  291. const HRESULT VSS_S_ASYNC_CANCELLED = (0x0004230BL);
  292. //
  293. // MessageId: VSS_E_VOLUME_NOT_SUPPORTED
  294. //
  295. // MessageText:
  296. //
  297. // Calling AddToSnapshotSet
  298. //
  299. const HRESULT VSS_E_VOLUME_NOT_SUPPORTED = (0x8004230CL);
  300. //
  301. // MessageId: VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER
  302. //
  303. // MessageText:
  304. //
  305. // Calling AddToSnapshotSet
  306. //
  307. const HRESULT VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER = (0x8004230EL);
  308. //
  309. // MessageId: VSS_E_OBJECT_ALREADY_EXISTS
  310. //
  311. // MessageText:
  312. //
  313. // Calling ExposeCurrentState
  314. //
  315. const HRESULT VSS_E_OBJECT_ALREADY_EXISTS = (0x8004230DL);
  316. //
  317. // MessageId: VSS_E_UNEXPECTED_PROVIDER_ERROR
  318. //
  319. // MessageText:
  320. //
  321. // Calling several methods supported by the providers.
  322. //
  323. const HRESULT VSS_E_UNEXPECTED_PROVIDER_ERROR = (0x8004230FL);
  324. //
  325. // MessageId: VSS_E_CORRUPT_XML_DOCUMENT
  326. //
  327. // MessageText:
  328. //
  329. // XML document unexpectedly does not match schema.
  330. //
  331. const HRESULT VSS_E_CORRUPT_XML_DOCUMENT = (0x80042310L);
  332. //
  333. // MessageId: VSS_E_CORRUPT_XML_DOCUMENT
  334. //
  335. // MessageText:
  336. //
  337. // An XML document passes as an argument is not valid, i.e., is either
  338. // not correctly formed XML or does not match the schema
  339. //
  340. const HRESULT VSS_E_INVALID_XML_DOCUMENT = (0x80042311L);
  341. //
  342. // MessageId: VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED
  343. //
  344. // MessageText:
  345. //
  346. // We cannot add any more volumes since we passed the maximum limit.
  347. //
  348. const HRESULT VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED = (0x80042312L);
  349. //
  350. // MessageId: VSS_E_FLUSH_WRITES_TIMEOUT
  351. //
  352. // MessageText:
  353. //
  354. // VSS couldn't flush I/O writes anymore.
  355. //
  356. const HRESULT VSS_E_FLUSH_WRITES_TIMEOUT = (0x80042313L);
  357. //
  358. // MessageId: VSS_E_HOLD_WRITES_TIMEOUT
  359. //
  360. // MessageText:
  361. //
  362. // VSS couldn't hold I/O writes anymore.
  363. //
  364. const HRESULT VSS_E_HOLD_WRITES_TIMEOUT = (0x80042314L);
  365. //
  366. // MessageId: VSS_E_UNEXPECTED_WRITER_ERROR
  367. //
  368. // MessageText:
  369. //
  370. // VSS encountered problems while sending events to writers
  371. //
  372. const HRESULT VSS_E_UNEXPECTED_WRITER_ERROR = (0x80042315L);
  373. //
  374. // MessageId: VSS_E_SNAPSHOT_SET_IN_PROGRESS
  375. //
  376. // MessageText:
  377. //
  378. // StartSnapshotSet was called when another snapshot set in in the
  379. // process of being created.
  380. //
  381. const HRESULT VSS_E_SNAPSHOT_SET_IN_PROGRESS = (0x80042316L);
  382. //
  383. // MessageId: VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED
  384. //
  385. // MessageText:
  386. //
  387. // AddToSnapshotSet was called on a volume that has already reached
  388. // its maxinum number
  389. //
  390. const HRESULT VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED = (0x80042317L);
  391. //
  392. // MessageId: VSS_E_WRITER_INFRASTRUCTURE
  393. //
  394. // The Writer infrastructure is not operating properly. Check that the
  395. // Event Service and the Volume Snapshot Service are started and check for
  396. // errors associdated with these services in the error log.
  397. //
  398. const HRESULT VSS_E_WRITER_INFRASTRUCTURE = (0x80042318L);
  399. //
  400. // MessageId: VSS_E_WRITER_NOT_RESPONDING
  401. //
  402. // A writer did not respond to a GetWriterStatus call. This means that
  403. // the process containing the writer died or is hung.
  404. //
  405. const HRESULT VSS_E_WRITER_NOT_RESPONDING = (0x80042319L);
  406. //
  407. // MessageId: VSS_E_WRITER_ALREADY_SUBSCRIBED
  408. //
  409. // A writer has already sucessfully called the Subscribe function. It cannot call
  410. // subscribe multiple times.
  411. //
  412. const HRESULT VSS_E_WRITER_ALREADY_SUBSCRIBED = (0x8004231AL);
  413. //
  414. // MessageId: VSS_E_UNSUPPORTED_CONTEXT
  415. //
  416. // Attempt to use an unsupported context.
  417. //
  418. const HRESULT VSS_E_UNSUPPORTED_CONTEXT = (0x8004231BL);
  419. //
  420. // MessageId: VSS_E_VOLUME_IN_USE
  421. //
  422. // MessageText:
  423. //
  424. // Calling ChangeDiffAreaMaximumSize
  425. //
  426. const HRESULT VSS_E_VOLUME_IN_USE = (0x8004231DL);
  427. //
  428. // MessageId: VSS_E_MAXIMUM_DIFFAREA_ASSOCIATIONS_REACHED
  429. //
  430. // MessageText:
  431. //
  432. // Calling AddDiffArea
  433. //
  434. const HRESULT VSS_E_MAXIMUM_DIFFAREA_ASSOCIATIONS_REACHED = (0x8004231EL);
  435. //
  436. // MessageId: VSS_E_INSUFFICIENT_STORAGE
  437. //
  438. // MessageText:
  439. //
  440. // Calling EndPrepareSnapshots, ChangeDiffAreaMaximumSize
  441. //
  442. const HRESULT VSS_E_INSUFFICIENT_STORAGE = (0x8004231FL);