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.

621 lines
18 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_PROCESSING_PREFINALCOMMIT,
  38. VSS_SS_PREFINALCOMMITTED,
  39. VSS_SS_PROCESSING_POSTFINALCOMMIT,
  40. VSS_SS_CREATED,
  41. VSS_SS_ABORTED,
  42. VSS_SS_DELETED,
  43. VSS_SS_COUNT
  44. } VSS_SNAPSHOT_STATE, *PVSS_SNAPSHOT_STATE;
  45. enum _VSS_VOLUME_SNAPSHOT_ATTRIBUTES {
  46. VSS_VOLSNAP_ATTR_PERSISTENT = 0x00000001,
  47. VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE = 0x00000004,
  48. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE = 0x00000008,
  49. VSS_VOLSNAP_ATTR_NO_WRITERS = 0x00000010,
  50. VSS_VOLSNAP_ATTR_TRANSPORTABLE = 0x00000020,
  51. VSS_VOLSNAP_ATTR_NOT_SURFACED = 0x00000040,
  52. VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED = 0x00010000,
  53. VSS_VOLSNAP_ATTR_DIFFERENTIAL = 0x00020000,
  54. VSS_VOLSNAP_ATTR_PLEX = 0x00040000,
  55. VSS_VOLSNAP_ATTR_IMPORTED = 0x00080000,
  56. VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY = 0x00100000,
  57. VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY = 0x00200000,
  58. VSS_VOLSNAP_ATTR_AUTORECOVER = 0x00400000
  59. };
  60. enum _VSS_SNAPSHOT_CONTEXT {
  61. VSS_CTX_BACKUP = 0x00000000,
  62. VSS_CTX_FILE_SHARE_BACKUP = VSS_VOLSNAP_ATTR_NO_WRITERS,
  63. VSS_CTX_NAS_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT |
  64. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE |
  65. VSS_VOLSNAP_ATTR_NO_WRITERS,
  66. VSS_CTX_APP_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT |
  67. VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE,
  68. VSS_CTX_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_FAILED_AT_BACKUPSHUTDOWN,
  91. VSS_WS_COUNT
  92. } VSS_WRITER_STATE, *PVSS_WRITER_STATE;
  93. typedef enum _VSS_BACKUP_TYPE {
  94. VSS_BT_UNDEFINED,
  95. VSS_BT_FULL,
  96. VSS_BT_INCREMENTAL,
  97. VSS_BT_DIFFERENTIAL,
  98. VSS_BT_LOG,
  99. VSS_BT_COPY,
  100. VSS_BT_OTHER
  101. } VSS_BACKUP_TYPE;
  102. typedef enum _VSS_RESTORE_TYPE {
  103. VSS_RTYPE_UNDEFINED,
  104. VSS_RTYPE_BY_COPY,
  105. VSS_RTYPE_IMPORT,
  106. VSS_RTYPE_OTHER
  107. } VSS_RESTORE_TYPE;
  108. typedef enum _VSS_PROVIDER_TYPE
  109. {
  110. VSS_PROV_UNKNOWN = 0,
  111. VSS_PROV_SYSTEM = 1,
  112. VSS_PROV_SOFTWARE = 2,
  113. VSS_PROV_HARDWARE = 3,
  114. } VSS_PROVIDER_TYPE, *PVSS_PROVIDER_TYPE;
  115. typedef enum _VSS_APPLICATION_LEVEL
  116. {
  117. VSS_APP_UNKNOWN = 0,
  118. VSS_APP_SYSTEM = 1,
  119. VSS_APP_BACK_END = 2,
  120. VSS_APP_FRONT_END = 3,
  121. VSS_APP_AUTO = -1,
  122. } VSS_APPLICATION_LEVEL, *PVSS_APPLICATION_LEVEL;
  123. // mask containing flags indicating what
  124. typedef enum _VSS_SNAPSHOT_COMPATIBILITY
  125. {
  126. VSS_SC_DISABLE_DEFRAG = 0x1,
  127. VSS_SC_DISABLE_CONTENTINDEX = 0x2
  128. } VSS_SNAPSHOT_COMPATIBILITY;
  129. typedef enum _VSS_SNAPSHOT_PROPERTY_ID {
  130. VSS_SPROPID_UNKNOWN = 0x00000000,
  131. VSS_SPROPID_SNAPSHOT_ID = 0x00000001,
  132. VSS_SPROPID_SNAPSHOT_SET_ID = 0x00000002,
  133. VSS_SPROPID_SNAPSHOTS_COUNT = 0x00000003,
  134. VSS_SPROPID_SNAPSHOT_DEVICE = 0x00000004,
  135. VSS_SPROPID_ORIGINAL_VOLUME = 0x00000005,
  136. VSS_SPROPID_ORIGINATING_MACHINE = 0x00000006,
  137. VSS_SPROPID_SERVICE_MACHINE = 0x00000007,
  138. VSS_SPROPID_EXPOSED_NAME = 0x00000008,
  139. VSS_SPROPID_EXPOSED_PATH = 0x00000009,
  140. VSS_SPROPID_PROVIDER_ID = 0x0000000A,
  141. VSS_SPROPID_SNAPSHOT_ATTRIBUTES = 0x0000000B,
  142. VSS_SPROPID_CREATION_TIMESTAMP = 0x0000000C,
  143. VSS_SPROPID_STATUS = 0x0000000D,
  144. } VSS_SNAPSHOT_PROPERTY_ID, *PVSS_SNAPSHOT_PROPERTY_ID;
  145. typedef enum _VSS_FILE_SPEC_BACKUP_TYPE {
  146. VSS_FSBT_FULL_BACKUP_REQUIRED = 0x00000001,
  147. VSS_FSBT_DIFFERENTIAL_BACKUP_REQUIRED = 0x00000002,
  148. VSS_FSBT_INCREMENTAL_BACKUP_REQUIRED = 0x00000004,
  149. VSS_FSBT_LOG_BACKUP_REQUIRED = 0x00000008,
  150. VSS_FSBT_FULL_SNAPSHOT_REQUIRED = 0x00000100,
  151. VSS_FSBT_DIFFERENTIAL_SNAPSHOT_REQUIRED = 0x00000200,
  152. VSS_FSBT_INCREMENTAL_SNAPSHOT_REQUIRED = 0x00000400,
  153. VSS_FSBT_LOG_SNAPSHOT_REQUIRED = 0x00000800,
  154. VSS_FSBT_ALL_BACKUP_REQUIRED = 0x0000000F,
  155. VSS_FSBT_ALL_SNAPSHOT_REQUIRED = 0x00000F00,
  156. } VSS_FILE_SPEC_BACKUP_TYPE, *PVSS_FILE_SPEC_BACKUP_TYPE;
  157. typedef enum _VSS_BACKUP_SCHEMA {
  158. VSS_BS_UNDEFINED = 0x00000000,
  159. VSS_BS_DIFFERENTIAL = 0x00000001,
  160. VSS_BS_INCREMENTAL = 0x00000002,
  161. VSS_BS_EXCLUSIVE_INCREMENTAL_DIFFERENTIAL = 0x00000004,
  162. VSS_BS_LOG = 0x00000008,
  163. VSS_BS_COPY = 0x00000010,
  164. VSS_BS_TIMESTAMPED = 0x00000020,
  165. VSS_BS_LAST_MODIFY = 0x00000040,
  166. VSS_BS_LSN = 0x00000080,
  167. VSS_BS_WRITER_SUPPORTS_NEW_TARGET = 0x00000100,
  168. } VSS_BACKUP_SCHEMA, *PVSS_BACKUP_SCHEMA;
  169. ////////////////////////////////////////////////////////
  170. // Typedefs and structures
  171. //
  172. typedef GUID VSS_ID;
  173. typedef [unique, string] WCHAR* VSS_PWSZ;
  174. typedef LONGLONG VSS_TIMESTAMP;
  175. typedef struct _VSS_SNAPSHOT_PROP {
  176. VSS_ID m_SnapshotId;
  177. VSS_ID m_SnapshotSetId;
  178. LONG m_lSnapshotsCount;
  179. VSS_PWSZ m_pwszSnapshotDeviceObject;
  180. VSS_PWSZ m_pwszOriginalVolumeName;
  181. VSS_PWSZ m_pwszOriginatingMachine;
  182. VSS_PWSZ m_pwszServiceMachine;
  183. VSS_PWSZ m_pwszExposedName;
  184. VSS_PWSZ m_pwszExposedPath;
  185. VSS_ID m_ProviderId;
  186. LONG m_lSnapshotAttributes;
  187. VSS_TIMESTAMP m_tsCreationTimestamp;
  188. VSS_SNAPSHOT_STATE m_eStatus;
  189. } VSS_SNAPSHOT_PROP, *PVSS_SNAPSHOT_PROP;
  190. typedef struct _VSS_PROVIDER_PROP {
  191. VSS_ID m_ProviderId;
  192. VSS_PWSZ m_pwszProviderName;
  193. VSS_PROVIDER_TYPE m_eProviderType;
  194. VSS_PWSZ m_pwszProviderVersion;
  195. VSS_ID m_ProviderVersionId;
  196. CLSID m_ClassId;
  197. } VSS_PROVIDER_PROP, *PVSS_PROVIDER_PROP;
  198. [ switch_type(VSS_OBJECT_TYPE) ]
  199. typedef union {
  200. [case(VSS_OBJECT_SNAPSHOT)] VSS_SNAPSHOT_PROP Snap;
  201. [case(VSS_OBJECT_PROVIDER)] VSS_PROVIDER_PROP Prov;
  202. [default];
  203. } VSS_OBJECT_UNION;
  204. typedef struct _VSS_OBJECT_PROP {
  205. VSS_OBJECT_TYPE Type;
  206. [ switch_is(Type) ] VSS_OBJECT_UNION Obj;
  207. } VSS_OBJECT_PROP, *PVSS_OBJECT_PROP;
  208. [
  209. object,
  210. uuid(AE1C7110-2F60-11d3-8A39-00C04F72D8E3),
  211. helpstring("IVssEnumObject Interface"),
  212. pointer_default(unique)
  213. ]
  214. interface IVssEnumObject : IUnknown
  215. {
  216. HRESULT Next(
  217. [in] ULONG celt,
  218. [out, size_is(celt), length_is(*pceltFetched)]
  219. VSS_OBJECT_PROP *rgelt,
  220. [out] ULONG *pceltFetched
  221. );
  222. HRESULT Skip(
  223. [in] ULONG celt
  224. );
  225. HRESULT Reset();
  226. HRESULT Clone(
  227. [in, out] IVssEnumObject **ppenum
  228. );
  229. };
  230. [
  231. object,
  232. uuid(507C37B4-CF5B-4e95-B0AF-14EB9767467E),
  233. helpstring("IVssAsync Interface"),
  234. pointer_default(unique)
  235. ]
  236. interface IVssAsync : IUnknown
  237. {
  238. [helpstring("method Cancel")]
  239. HRESULT Cancel();
  240. [helpstring("method Wait")]
  241. HRESULT Wait(
  242. [in, defaultvalue(0xFFFFFFFF)] DWORD dwMilliseconds
  243. );
  244. [helpstring("method QueryStatus")]
  245. HRESULT QueryStatus(
  246. [out] HRESULT* pHrResult,
  247. [in, out, unique] INT* pReserved
  248. );
  249. };
  250. /////////////////////////////////////////////////////////////////////////////
  251. // VSS HRESULT errors
  252. //
  253. // MessageId: VSS_E_BAD_STATE
  254. //
  255. // MessageText:
  256. //
  257. // A function call was invalid because of the state of either the
  258. // backup extensions or the coordinator. For example calling AddToSnapshot
  259. // set prior to calling StartSnapshotSet.
  260. //
  261. const HRESULT VSS_E_BAD_STATE = (0x80042301L);
  262. //
  263. // MessageId: VSS_E_PROVIDER_ALREADY_REGISTERED
  264. //
  265. // MessageText:
  266. //
  267. // Calling RegisterProvider
  268. //
  269. const HRESULT VSS_E_PROVIDER_ALREADY_REGISTERED = (0x80042303L);
  270. //
  271. // MessageId: VSS_E_PROVIDER_NOT_REGISTERED
  272. //
  273. // MessageText:
  274. //
  275. // Calling UnregisterProvider
  276. //
  277. const HRESULT VSS_E_PROVIDER_NOT_REGISTERED = (0x80042304L);
  278. //
  279. // MessageId: VSS_E_PROVIDER_VETO
  280. //
  281. // MessageText:
  282. //
  283. // Calling DoSnapshotSet
  284. //
  285. const HRESULT VSS_E_PROVIDER_VETO = (0x80042306L);
  286. //
  287. // MessageId: VSS_E_PROVIDER_IN_USE
  288. //
  289. // MessageText:
  290. //
  291. // Calling UnregisterProvider, StartSnapshotSet
  292. //
  293. const HRESULT VSS_E_PROVIDER_IN_USE = (0x80042307L);
  294. //
  295. // MessageId: VSS_E_OBJECT_NOT_FOUND
  296. //
  297. // MessageText:
  298. //
  299. // Calling DeleteSnapshots, Query
  300. //
  301. const HRESULT VSS_E_OBJECT_NOT_FOUND = (0x80042308L);
  302. //
  303. // MessageId: VSS_S_ASYNC_PENDING
  304. //
  305. // MessageText:
  306. //
  307. // Calling IVssAsync::QueryStatus
  308. //
  309. const HRESULT VSS_S_ASYNC_PENDING = (0x00042309L);
  310. //
  311. // MessageId: VSS_S_ASYNC_FINISHED
  312. //
  313. // MessageText:
  314. //
  315. // Calling IVssAsync::QueryStatus
  316. //
  317. const HRESULT VSS_S_ASYNC_FINISHED = (0x0004230AL);
  318. //
  319. // MessageId: VSS_S_ASYNC_CANCELLED
  320. //
  321. // MessageText:
  322. //
  323. // Calling IVssAsync::QueryStatus
  324. //
  325. const HRESULT VSS_S_ASYNC_CANCELLED = (0x0004230BL);
  326. //
  327. // MessageId: VSS_E_VOLUME_NOT_SUPPORTED
  328. //
  329. // MessageText:
  330. //
  331. // Calling AddToSnapshotSet
  332. //
  333. const HRESULT VSS_E_VOLUME_NOT_SUPPORTED = (0x8004230CL);
  334. //
  335. // MessageId: VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER
  336. //
  337. // MessageText:
  338. //
  339. // Calling AddToSnapshotSet
  340. //
  341. const HRESULT VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER = (0x8004230EL);
  342. //
  343. // MessageId: VSS_E_OBJECT_ALREADY_EXISTS
  344. //
  345. // MessageText:
  346. //
  347. // Calling ExposeCurrentState
  348. //
  349. const HRESULT VSS_E_OBJECT_ALREADY_EXISTS = (0x8004230DL);
  350. //
  351. // MessageId: VSS_E_UNEXPECTED_PROVIDER_ERROR
  352. //
  353. // MessageText:
  354. //
  355. // Calling several methods supported by the providers.
  356. //
  357. const HRESULT VSS_E_UNEXPECTED_PROVIDER_ERROR = (0x8004230FL);
  358. //
  359. // MessageId: VSS_E_CORRUPT_XML_DOCUMENT
  360. //
  361. // MessageText:
  362. //
  363. // XML document unexpectedly does not match schema.
  364. //
  365. const HRESULT VSS_E_CORRUPT_XML_DOCUMENT = (0x80042310L);
  366. //
  367. // MessageId: VSS_E_CORRUPT_XML_DOCUMENT
  368. //
  369. // MessageText:
  370. //
  371. // An XML document passes as an argument is not valid, i.e., is either
  372. // not correctly formed XML or does not match the schema
  373. //
  374. const HRESULT VSS_E_INVALID_XML_DOCUMENT = (0x80042311L);
  375. //
  376. // MessageId: VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED
  377. //
  378. // MessageText:
  379. //
  380. // We cannot add any more volumes since we passed the maximum limit.
  381. //
  382. const HRESULT VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED = (0x80042312L);
  383. //
  384. // MessageId: VSS_E_FLUSH_WRITES_TIMEOUT
  385. //
  386. // MessageText:
  387. //
  388. // VSS couldn't flush I/O writes anymore.
  389. //
  390. const HRESULT VSS_E_FLUSH_WRITES_TIMEOUT = (0x80042313L);
  391. //
  392. // MessageId: VSS_E_HOLD_WRITES_TIMEOUT
  393. //
  394. // MessageText:
  395. //
  396. // VSS couldn't hold I/O writes anymore.
  397. //
  398. const HRESULT VSS_E_HOLD_WRITES_TIMEOUT = (0x80042314L);
  399. //
  400. // MessageId: VSS_E_UNEXPECTED_WRITER_ERROR
  401. //
  402. // MessageText:
  403. //
  404. // VSS encountered problems while sending events to writers
  405. //
  406. const HRESULT VSS_E_UNEXPECTED_WRITER_ERROR = (0x80042315L);
  407. //
  408. // MessageId: VSS_E_SNAPSHOT_SET_IN_PROGRESS
  409. //
  410. // MessageText:
  411. //
  412. // StartSnapshotSet was called when another snapshot set in in the
  413. // process of being created.
  414. //
  415. const HRESULT VSS_E_SNAPSHOT_SET_IN_PROGRESS = (0x80042316L);
  416. //
  417. // MessageId: VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED
  418. //
  419. // MessageText:
  420. //
  421. // AddToSnapshotSet was called on a volume that has already reached
  422. // its maxinum number
  423. //
  424. const HRESULT VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED = (0x80042317L);
  425. //
  426. // MessageId: VSS_E_WRITER_INFRASTRUCTURE
  427. //
  428. // The Writer infrastructure is not operating properly. Check that the
  429. // Event Service and the Volume Snapshot Service are started and check for
  430. // errors associdated with these services in the error log.
  431. //
  432. const HRESULT VSS_E_WRITER_INFRASTRUCTURE = (0x80042318L);
  433. //
  434. // MessageId: VSS_E_WRITER_NOT_RESPONDING
  435. //
  436. // A writer did not respond to a GetWriterStatus call. This means that
  437. // the process containing the writer died or is hung.
  438. //
  439. const HRESULT VSS_E_WRITER_NOT_RESPONDING = (0x80042319L);
  440. //
  441. // MessageId: VSS_E_WRITER_ALREADY_SUBSCRIBED
  442. //
  443. // A writer has already sucessfully called the Subscribe function. It cannot call
  444. // subscribe multiple times.
  445. //
  446. const HRESULT VSS_E_WRITER_ALREADY_SUBSCRIBED = (0x8004231AL);
  447. //
  448. // MessageId: VSS_E_UNSUPPORTED_CONTEXT
  449. //
  450. // Attempt to use an unsupported context.
  451. //
  452. const HRESULT VSS_E_UNSUPPORTED_CONTEXT = (0x8004231BL);
  453. //
  454. // MessageId: VSS_E_VOLUME_IN_USE
  455. //
  456. // MessageText:
  457. //
  458. // Calling ChangeDiffAreaMaximumSize
  459. //
  460. const HRESULT VSS_E_VOLUME_IN_USE = (0x8004231DL);
  461. //
  462. // MessageId: VSS_E_MAXIMUM_DIFFAREA_ASSOCIATIONS_REACHED
  463. //
  464. // MessageText:
  465. //
  466. // Calling AddDiffArea
  467. //
  468. const HRESULT VSS_E_MAXIMUM_DIFFAREA_ASSOCIATIONS_REACHED = (0x8004231EL);
  469. //
  470. // MessageId: VSS_E_INSUFFICIENT_STORAGE
  471. //
  472. // MessageText:
  473. //
  474. // Calling EndPrepareSnapshots, ChangeDiffAreaMaximumSize
  475. //
  476. const HRESULT VSS_E_INSUFFICIENT_STORAGE = (0x8004231FL);
  477. //
  478. // MessageId: VSS_E_NO_SNAPSHOTS_IMPORTED
  479. //
  480. // MessageText:
  481. //
  482. // Calling ImportSnapshots, no volumes were successfully imported
  483. //
  484. const HRESULT VSS_E_NO_SNAPSHOTS_IMPORTED = (0x80042320L);
  485. // MessageId: VSS_S_SOME_SNAPSHOTS_NOT_IMPORTED
  486. //
  487. // MessageText:
  488. //
  489. // Calling ImportSnapshots, some volumes were not successfully imported
  490. //
  491. const HRESULT VSS_S_SOME_SNAPSHOTS_NOT_IMPORTED = (0x00042320L);