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.

812 lines
20 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Abstract:
  4. @doc
  5. @module Writer.h | Declaration of Writer
  6. @end
  7. Author:
  8. Adi Oltean [aoltean] 08/18/1999
  9. TBD:
  10. Add comments.
  11. Revision History:
  12. Name Date Comments
  13. aoltean 08/18/1999 Created
  14. brianb 03/28/2000 hid implementation details
  15. mikejohn 09/18/2000 176860: Added calling convention methods where missing
  16. --*/
  17. #ifndef __CVSS_WRITER_H_
  18. #define __CVSS_WRITER_H_
  19. // declaration of how application data is used
  20. typedef enum VSS_USAGE_TYPE
  21. {
  22. VSS_UT_UNDEFINED = 0,
  23. VSS_UT_BOOTABLESYSTEMSTATE, // formerly "system state"
  24. VSS_UT_SYSTEMSERVICE, // system service
  25. VSS_UT_USERDATA, // user data
  26. VSS_UT_OTHER // unclassified
  27. };
  28. typedef enum VSS_SOURCE_TYPE
  29. {
  30. VSS_ST_UNDEFINED = 0,
  31. VSS_ST_TRANSACTEDDB, // transacted db (e.g., SQL Server, JET Blue)
  32. VSS_ST_NONTRANSACTEDDB, // not transacted(e.g., Jet Red)
  33. VSS_ST_OTHER // unclassified
  34. };
  35. typedef enum VSS_RESTOREMETHOD_ENUM
  36. {
  37. VSS_RME_UNDEFINED = 0,
  38. VSS_RME_RESTORE_IF_NOT_THERE,
  39. VSS_RME_RESTORE_IF_CAN_REPLACE,
  40. VSS_RME_STOP_RESTORE_START,
  41. VSS_RME_RESTORE_TO_ALTERNATE_LOCATION,
  42. VSS_RME_RESTORE_AT_REBOOT,
  43. VSS_RME_RESTORE_AT_REBOOT_IF_CANNOT_REPLACE,
  44. VSS_RME_CUSTOM
  45. };
  46. typedef enum VSS_WRITERRESTORE_ENUM
  47. {
  48. VSS_WRE_UNDEFINED = 0,
  49. VSS_WRE_NEVER,
  50. VSS_WRE_IF_REPLACE_FAILS,
  51. VSS_WRE_ALWAYS
  52. };
  53. typedef enum VSS_COMPONENT_TYPE
  54. {
  55. VSS_CT_UNDEFINED = 0,
  56. VSS_CT_DATABASE,
  57. VSS_CT_FILEGROUP
  58. };
  59. typedef enum VSS_ALTERNATE_WRITER_STATE
  60. {
  61. VSS_AWS_UNDEFINED = 0,
  62. VSS_AWS_NO_ALTERNATE_WRITER,
  63. VSS_AWS_ALTERNATE_WRITER_EXISTS,
  64. VSS_AWS_THIS_IS_ALTERNATE_WRITER
  65. };
  66. // Flags to specify which types of events to receive. Used in Subscribe.
  67. typedef enum VSS_SUBSCRIBE_MASK
  68. {
  69. VSS_SM_POST_SNAPSHOT_FLAG = 0x00000001,
  70. VSS_SM_BACKUP_EVENTS_FLAG = 0x00000002,
  71. VSS_SM_RESTORE_EVENTS_FLAG = 0x00000004,
  72. VSS_SM_IO_THROTTLING_FLAG = 0x00000008,
  73. VSS_SM_ALL_FLAGS = 0xffffffff
  74. };
  75. // enumeration of restore targets
  76. typedef enum VSS_RESTORE_TARGET
  77. {
  78. VSS_RT_UNDEFINED = 0,
  79. VSS_RT_ORIGINAL,
  80. VSS_RT_ALTERNATE,
  81. VSS_RT_DIRECTED
  82. };
  83. // enumeration of file restore status codes
  84. typedef enum VSS_FILE_RESTORE_STATUS
  85. {
  86. VSS_RS_UNDEFINED = 0,
  87. VSS_RS_NONE,
  88. VSS_RS_ALL,
  89. VSS_RS_FAILED
  90. };
  91. typedef enum VSS_COMPONENT_FLAGS
  92. {
  93. VSS_CF_BACKUP_RECOVERY = 0x00000001,
  94. VSS_CF_APP_ROLLBACK_RECOVERY = 0x00000002
  95. };
  96. // file description
  97. class IVssWMFiledesc : public IUnknown
  98. {
  99. public:
  100. // get path to toplevel directory
  101. STDMETHOD(GetPath)(OUT BSTR *pbstrPath) = 0;
  102. // get filespec (may include wildcards)
  103. STDMETHOD(GetFilespec)(OUT BSTR *pbstrFilespec) = 0;
  104. // is path a directory or root of a tree
  105. STDMETHOD(GetRecursive)(OUT bool *pbRecursive) = 0;
  106. // alternate location for files
  107. STDMETHOD(GetAlternateLocation)(OUT BSTR *pbstrAlternateLocation) = 0;
  108. // backup type
  109. STDMETHOD(GetBackupTypeMask)(OUT DWORD *pdwTypeMask) = 0;
  110. };
  111. // dependency description
  112. class IVssWMDependency : public IUnknown
  113. {
  114. public:
  115. STDMETHOD(GetWriterId)(OUT VSS_ID *pWriterId) = 0;
  116. STDMETHOD(GetLogicalPath)(OUT BSTR *pbstrLogicalPath) = 0;
  117. STDMETHOD(GetComponentName)(OUT BSTR *pbstrComponentName) = 0;
  118. };
  119. // backup components interface
  120. class IVssComponent : public IUnknown
  121. {
  122. public:
  123. // obtain logical path of component
  124. STDMETHOD(GetLogicalPath)(OUT BSTR *pbstrPath) = 0;
  125. // obtain component type(VSS_CT_DATABASE or VSS_CT_FILEGROUP)
  126. STDMETHOD(GetComponentType)(VSS_COMPONENT_TYPE *pct) = 0;
  127. // get component name
  128. STDMETHOD(GetComponentName)(OUT BSTR *pbstrName) = 0;
  129. // determine whether the component was successfully backed up.
  130. STDMETHOD(GetBackupSucceeded)(OUT bool *pbSucceeded) = 0;
  131. // get altermative location mapping count
  132. STDMETHOD(GetAlternateLocationMappingCount)
  133. (
  134. OUT UINT *pcMappings
  135. ) = 0;
  136. // get a paraticular alternative location mapping
  137. STDMETHOD(GetAlternateLocationMapping)
  138. (
  139. IN UINT iMapping,
  140. OUT IVssWMFiledesc **ppFiledesc
  141. ) = 0;
  142. // set the backup metadata for a component
  143. STDMETHOD(SetBackupMetadata)
  144. (
  145. IN LPCWSTR wszData
  146. ) = 0;
  147. // get the backup metadata for a component
  148. STDMETHOD(GetBackupMetadata)
  149. (
  150. OUT BSTR *pbstrData
  151. ) = 0;
  152. // indicate that only ranges in the file are to be backed up
  153. STDMETHOD(AddPartialFile)
  154. (
  155. IN LPCWSTR wszPath,
  156. IN LPCWSTR wszFilename,
  157. IN LPCWSTR wszRanges,
  158. IN LPCWSTR wszMetadata
  159. ) = 0;
  160. // get count of partial file declarations
  161. STDMETHOD(GetPartialFileCount)
  162. (
  163. OUT UINT *pcPartialFiles
  164. ) = 0;
  165. // get a partial file declaration
  166. STDMETHOD(GetPartialFile)
  167. (
  168. IN UINT iPartialFile,
  169. OUT BSTR *pbstrPath,
  170. OUT BSTR *pbstrFilename,
  171. OUT BSTR *pbstrRange,
  172. OUT BSTR *pbstrMetadata
  173. ) = 0;
  174. // determine if the component is selected to be restored
  175. STDMETHOD(IsSelectedForRestore)
  176. (
  177. OUT bool *pbSelectedForRestore
  178. ) = 0;
  179. STDMETHOD(GetAdditionalRestores)
  180. (
  181. OUT bool *pbAdditionalRestores
  182. ) = 0;
  183. // get count of new target specifications
  184. STDMETHOD(GetNewTargetCount)
  185. (
  186. OUT UINT *pcNewTarget
  187. ) = 0;
  188. STDMETHOD(GetNewTarget)
  189. (
  190. IN UINT iNewTarget,
  191. OUT IVssWMFiledesc **ppFiledesc
  192. ) = 0;
  193. // add a directed target specification
  194. STDMETHOD(AddDirectedTarget)
  195. (
  196. IN LPCWSTR wszSourcePath,
  197. IN LPCWSTR wszSourceFilename,
  198. IN LPCWSTR wszSourceRangeList,
  199. IN LPCWSTR wszDestinationPath,
  200. IN LPCWSTR wszDestinationFilename,
  201. IN LPCWSTR wszDestinationRangeList
  202. ) = 0;
  203. // get count of directed target specifications
  204. STDMETHOD(GetDirectedTargetCount)
  205. (
  206. OUT UINT *pcDirectedTarget
  207. ) = 0;
  208. // obtain a particular directed target specification
  209. STDMETHOD(GetDirectedTarget)
  210. (
  211. IN UINT iDirectedTarget,
  212. OUT BSTR *pbstrSourcePath,
  213. OUT BSTR *pbstrSourceFileName,
  214. OUT BSTR *pbstrSourceRangeList,
  215. OUT BSTR *pbstrDestinationPath,
  216. OUT BSTR *pbstrDestinationFilename,
  217. OUT BSTR *pbstrDestinationRangeList
  218. ) = 0;
  219. // set restore metadata associated with the component
  220. STDMETHOD(SetRestoreMetadata)
  221. (
  222. IN LPCWSTR wszRestoreMetadata
  223. ) = 0;
  224. // obtain restore metadata associated with the component
  225. STDMETHOD(GetRestoreMetadata)
  226. (
  227. OUT BSTR *pbstrRestoreMetadata
  228. ) = 0;
  229. // set the restore target
  230. STDMETHOD(SetRestoreTarget)
  231. (
  232. IN VSS_RESTORE_TARGET target
  233. ) = 0;
  234. // obtain the restore target
  235. STDMETHOD(GetRestoreTarget)
  236. (
  237. OUT VSS_RESTORE_TARGET *pTarget
  238. ) = 0;
  239. // set failure message during pre restore event
  240. STDMETHOD(SetPreRestoreFailureMsg)
  241. (
  242. IN LPCWSTR wszPreRestoreFailureMsg
  243. ) = 0;
  244. // obtain failure message during pre restore event
  245. STDMETHOD(GetPreRestoreFailureMsg)
  246. (
  247. OUT BSTR *pbstrPreRestoreFailureMsg
  248. ) = 0;
  249. // set the failure message during the post restore event
  250. STDMETHOD(SetPostRestoreFailureMsg)
  251. (
  252. IN LPCWSTR wszPostRestoreFailureMsg
  253. ) = 0;
  254. // obtain the failure message set during the post restore event
  255. STDMETHOD(GetPostRestoreFailureMsg)
  256. (
  257. OUT BSTR *pbstrPostRestoreFailureMsg
  258. ) = 0;
  259. // set the backup stamp of the backup
  260. STDMETHOD(SetBackupStamp)
  261. (
  262. IN LPCWSTR wszBackupStamp
  263. ) = 0;
  264. // obtain the stamp of the backup
  265. STDMETHOD(GetBackupStamp)
  266. (
  267. OUT BSTR *pbstrBackupStamp
  268. ) = 0;
  269. // obtain the backup stamp that the differential or incremental
  270. // backup is baed on
  271. STDMETHOD(GetPreviousBackupStamp)
  272. (
  273. OUT BSTR *pbstrBackupStamp
  274. ) = 0;
  275. // obtain backup options for the writer
  276. STDMETHOD(GetBackupOptions)
  277. (
  278. OUT BSTR *pbstrBackupOptions
  279. ) = 0;
  280. // obtain the restore options
  281. STDMETHOD(GetRestoreOptions)
  282. (
  283. OUT BSTR *pbstrRestoreOptions
  284. ) = 0;
  285. // obtain count of subcomponents to be restored
  286. STDMETHOD(GetRestoreSubcomponentCount)
  287. (
  288. OUT UINT *pcRestoreSubcomponent
  289. ) = 0;
  290. // obtain a particular subcomponent to be restored
  291. STDMETHOD(GetRestoreSubcomponent)
  292. (
  293. UINT iComponent,
  294. OUT BSTR *pbstrLogicalPath,
  295. OUT BSTR *pbstrComponentName,
  296. OUT bool *pbRepair
  297. ) = 0;
  298. // obtain whether files were successfully restored
  299. STDMETHOD(GetFileRestoreStatus)
  300. (
  301. OUT VSS_FILE_RESTORE_STATUS *pStatus
  302. ) = 0;
  303. // add differenced files by last modify time
  304. STDMETHOD(AddDifferencedFilesByLastModifyTime)
  305. (
  306. IN LPCWSTR wszPath,
  307. IN LPCWSTR wszFilespec,
  308. IN BOOL bRecursive,
  309. IN FILETIME ftLastModifyTime
  310. ) = 0;
  311. STDMETHOD(AddDifferencedFilesByLastModifyLSN)
  312. (
  313. IN LPCWSTR wszPath,
  314. IN LPCWSTR wszFilespec,
  315. IN BOOL bRecursive,
  316. IN BSTR bstrLsnString
  317. ) = 0;
  318. STDMETHOD(GetDifferencedFilesCount)
  319. (
  320. OUT UINT *pcDifferencedFiles
  321. ) = 0;
  322. STDMETHOD(GetDifferencedFile)
  323. (
  324. IN UINT iDifferencedFile,
  325. OUT BSTR *pbstrPath,
  326. OUT BSTR *pbstrFilespec,
  327. OUT BOOL *pbRecursive,
  328. OUT BSTR *pbstrLsnString,
  329. OUT FILETIME *pftLastModifyTime
  330. ) = 0;
  331. };
  332. // backup writer components interface (i.e., all components for an
  333. // individual writer
  334. class IVssWriterComponents
  335. {
  336. public:
  337. // get count of components
  338. STDMETHOD(GetComponentCount)(OUT UINT *pcComponents) = 0;
  339. // get information about the writer
  340. STDMETHOD(GetWriterInfo)
  341. (
  342. OUT VSS_ID *pidInstance,
  343. OUT VSS_ID *pidWriter
  344. ) = 0;
  345. // obtain a specific component
  346. STDMETHOD(GetComponent)
  347. (
  348. IN UINT iComponent,
  349. OUT IVssComponent **ppComponent
  350. ) = 0;
  351. };
  352. // create backup metadata interface
  353. class IVssCreateWriterMetadata
  354. {
  355. public:
  356. // add files to include to metadata document
  357. STDMETHOD(AddIncludeFiles)
  358. (
  359. IN LPCWSTR wszPath,
  360. IN LPCWSTR wszFilespec,
  361. IN bool bRecursive,
  362. IN LPCWSTR wszAlternateLocation
  363. ) = 0;
  364. // add files to exclude to metadata document
  365. STDMETHOD(AddExcludeFiles)
  366. (
  367. IN LPCWSTR wszPath,
  368. IN LPCWSTR wszFilespec,
  369. IN bool bRecursive
  370. ) = 0;
  371. // add component to metadata document
  372. STDMETHOD(AddComponent)
  373. (
  374. IN VSS_COMPONENT_TYPE ct,
  375. IN LPCWSTR wszLogicalPath,
  376. IN LPCWSTR wszComponentName,
  377. IN LPCWSTR wszCaption,
  378. IN const BYTE *pbIcon,
  379. IN UINT cbIcon,
  380. IN bool bRestoreMetadata,
  381. IN bool bNotifyOnBackupComplete,
  382. IN bool bSelectable,
  383. IN bool bSelectableForRestore = false,
  384. IN DWORD dwComponentFlags = 0
  385. ) = 0;
  386. // add physical database files to a database component
  387. STDMETHOD(AddDatabaseFiles)
  388. (
  389. IN LPCWSTR wszLogicalPath,
  390. IN LPCWSTR wszDatabaseName,
  391. IN LPCWSTR wszPath,
  392. IN LPCWSTR wszFilespec,
  393. IN DWORD dwBackupTypeMask = (VSS_FSBT_ALL_BACKUP_REQUIRED |
  394. VSS_FSBT_ALL_SNAPSHOT_REQUIRED)
  395. ) = 0;
  396. // add log files to a database component
  397. STDMETHOD(AddDatabaseLogFiles)
  398. (
  399. IN LPCWSTR wszLogicalPath,
  400. IN LPCWSTR wszDatabaseName,
  401. IN LPCWSTR wszPath,
  402. IN LPCWSTR wszFilespec,
  403. IN DWORD dwBackupTypeMask = (VSS_FSBT_ALL_BACKUP_REQUIRED |
  404. VSS_FSBT_ALL_SNAPSHOT_REQUIRED)
  405. ) = 0;
  406. // add files to a FILE_GROUP component
  407. STDMETHOD(AddFilesToFileGroup)
  408. (
  409. IN LPCWSTR wszLogicalPath,
  410. IN LPCWSTR wszGroupName,
  411. IN LPCWSTR wszPath,
  412. IN LPCWSTR wszFilespec,
  413. IN bool bRecursive,
  414. IN LPCWSTR wszAlternateLocation,
  415. IN DWORD dwBackupTypeMask = (VSS_FSBT_ALL_BACKUP_REQUIRED |
  416. VSS_FSBT_ALL_SNAPSHOT_REQUIRED)
  417. ) = 0;
  418. // create a restore method
  419. STDMETHOD(SetRestoreMethod)
  420. (
  421. IN VSS_RESTOREMETHOD_ENUM method,
  422. IN LPCWSTR wszService,
  423. IN LPCWSTR wszUserProcedure,
  424. IN VSS_WRITERRESTORE_ENUM writerRestore,
  425. IN bool bRebootRequired
  426. ) = 0;
  427. // add alternative location mappings to the restore method
  428. STDMETHOD(AddAlternateLocationMapping)
  429. (
  430. IN LPCWSTR wszSourcePath,
  431. IN LPCWSTR wszSourceFilespec,
  432. IN bool bRecursive,
  433. IN LPCWSTR wszDestination
  434. ) = 0;
  435. // add a dependency to another writer's component
  436. STDMETHOD(AddComponentDependency)
  437. (
  438. IN LPCWSTR wszForLogicalPath,
  439. IN LPCWSTR wszForComponentName,
  440. IN VSS_ID onWriterId,
  441. IN LPCWSTR wszOnLogicalPath,
  442. IN LPCWSTR wszOnComponentName
  443. ) = 0;
  444. // Set the schema used during backup
  445. STDMETHOD(SetBackupSchema)
  446. (
  447. IN DWORD dwSchemaMask
  448. ) = 0;
  449. // obtain reference to actual XML document
  450. STDMETHOD(GetDocument)(IXMLDOMDocument **pDoc) = 0;
  451. // save document as an XML string
  452. STDMETHOD(SaveAsXML)(BSTR *pbstrXML) = 0;
  453. };
  454. class IVssWriterImpl;
  455. /////////////////////////////////////////////////////////////////////////////
  456. // CVssWriter
  457. class CVssWriter
  458. {
  459. // Constants
  460. public:
  461. // Constructors & Destructors
  462. public:
  463. __declspec(dllexport)
  464. STDMETHODCALLTYPE CVssWriter();
  465. __declspec(dllexport)
  466. virtual STDMETHODCALLTYPE ~CVssWriter();
  467. // Exposed operations
  468. public:
  469. // initialize the writer object
  470. __declspec(dllexport)
  471. HRESULT STDMETHODCALLTYPE Initialize
  472. (
  473. IN VSS_ID WriterID,
  474. IN LPCWSTR wszWriterName,
  475. IN VSS_USAGE_TYPE ut,
  476. IN VSS_SOURCE_TYPE st,
  477. IN VSS_APPLICATION_LEVEL nLevel = VSS_APP_FRONT_END,
  478. IN DWORD dwTimeoutFreeze = 60000, // Maximum milliseconds between Freeze/Thaw
  479. IN VSS_ALTERNATE_WRITER_STATE aws = VSS_AWS_NO_ALTERNATE_WRITER,
  480. IN bool bIOThrottlingOnly = false,
  481. IN LPCWSTR wszReserved = NULL
  482. );
  483. // cause the writer to subscribe to events.
  484. __declspec(dllexport)
  485. HRESULT STDMETHODCALLTYPE Subscribe
  486. (
  487. IN DWORD dwEventFlags = VSS_SM_BACKUP_EVENTS_FLAG | VSS_SM_RESTORE_EVENTS_FLAG
  488. );
  489. // cause the writer to unsubscribe from events
  490. __declspec(dllexport)
  491. HRESULT STDMETHODCALLTYPE Unsubscribe();
  492. // installs an alternative writer
  493. __declspec(dllexport)
  494. HRESULT STDMETHODCALLTYPE InstallAlternateWriter
  495. (
  496. IN VSS_ID writerId,
  497. IN CLSID persistentWriterClassId
  498. );
  499. // Internal properties - accessible from OnXXX methods
  500. protected:
  501. // get array of volume names
  502. __declspec(dllexport)
  503. LPCWSTR* STDMETHODCALLTYPE GetCurrentVolumeArray() const;
  504. // get count of volume names in array
  505. __declspec(dllexport)
  506. UINT STDMETHODCALLTYPE GetCurrentVolumeCount() const;
  507. // get the name of the snapshot device corresponding to a given volume.
  508. __declspec(dllexport)
  509. HRESULT STDMETHODCALLTYPE GetSnapshotDeviceName
  510. (
  511. IN LPCWSTR wszOriginalVolume,
  512. OUT LPCWSTR* ppwszSnapshotDevice
  513. ) const;
  514. // current snapshot set GUID
  515. __declspec(dllexport)
  516. VSS_ID STDMETHODCALLTYPE GetCurrentSnapshotSetId() const;
  517. // Current backup context.
  518. __declspec(dllexport)
  519. LONG STDMETHODCALLTYPE GetContext() const;
  520. // current app level (either 1,2,3)
  521. __declspec(dllexport)
  522. VSS_APPLICATION_LEVEL STDMETHODCALLTYPE GetCurrentLevel() const;
  523. // determine if path is in set of volumes being snapshotted
  524. __declspec(dllexport)
  525. bool STDMETHODCALLTYPE IsPathAffected
  526. (
  527. IN LPCWSTR wszPath
  528. ) const;
  529. // does the backup include bootable state (formerly system state backup)
  530. __declspec(dllexport)
  531. bool STDMETHODCALLTYPE IsBootableSystemStateBackedUp() const;
  532. // is the backup application smart (i.e., selecting components) or
  533. // dump (i.e., just selecting volumes)
  534. __declspec(dllexport)
  535. bool STDMETHODCALLTYPE AreComponentsSelected() const;
  536. __declspec(dllexport)
  537. VSS_BACKUP_TYPE STDMETHODCALLTYPE GetBackupType() const;
  538. __declspec(dllexport)
  539. VSS_RESTORE_TYPE STDMETHODCALLTYPE GetRestoreType() const;
  540. __declspec(dllexport)
  541. bool STDMETHODCALLTYPE IsPartialFileSupportEnabled() const;
  542. _declspec(dllexport)
  543. HRESULT STDMETHODCALLTYPE SetWriterFailure(HRESULT hr);
  544. // Ovverides
  545. public:
  546. // callback when request for metadata comes in
  547. __declspec(dllexport)
  548. virtual bool STDMETHODCALLTYPE OnIdentify(IN IVssCreateWriterMetadata *pMetadata);
  549. // callback for prepare backup event
  550. __declspec(dllexport)
  551. virtual bool STDMETHODCALLTYPE OnPrepareBackup(
  552. IN IVssWriterComponents *pComponent
  553. );
  554. // callback for prepare snapsot event
  555. virtual bool STDMETHODCALLTYPE OnPrepareSnapshot() = 0;
  556. // callback for freeze event
  557. virtual bool STDMETHODCALLTYPE OnFreeze() = 0;
  558. // callback for thaw event
  559. virtual bool STDMETHODCALLTYPE OnThaw() = 0;
  560. // callback if current sequence is aborted
  561. virtual bool STDMETHODCALLTYPE OnAbort() = 0;
  562. // callback on backup complete event
  563. __declspec(dllexport)
  564. virtual bool STDMETHODCALLTYPE OnBackupComplete
  565. (
  566. IN IVssWriterComponents *pComponent
  567. );
  568. // callback indicating that the backup process has either completed or has shut down
  569. __declspec(dllexport)
  570. virtual bool STDMETHODCALLTYPE OnBackupShutdown
  571. (
  572. IN VSS_ID SnapshotSetId
  573. );
  574. // callback on pre-restore event
  575. __declspec(dllexport)
  576. virtual bool STDMETHODCALLTYPE OnPreRestore
  577. (
  578. IN IVssWriterComponents *pComponent
  579. );
  580. // callback on post-restore event
  581. __declspec(dllexport)
  582. virtual bool STDMETHODCALLTYPE OnPostRestore
  583. (
  584. IN IVssWriterComponents *pComponent
  585. );
  586. // callback on post snapshot event
  587. __declspec(dllexport)
  588. virtual bool STDMETHODCALLTYPE OnPostSnapshot
  589. (
  590. IN IVssWriterComponents *pComponent
  591. );
  592. // callback on back off I/O volume event
  593. __declspec(dllexport)
  594. virtual bool STDMETHODCALLTYPE OnBackOffIOOnVolume
  595. (
  596. IN VSS_PWSZ wszVolumeName,
  597. IN VSS_ID snapshotId,
  598. IN VSS_ID providerId
  599. );
  600. // callback on Continue I/O on volume event
  601. __declspec(dllexport)
  602. virtual bool STDMETHODCALLTYPE OnContinueIOOnVolume
  603. (
  604. IN VSS_PWSZ wszVolumeName,
  605. IN VSS_ID snapshotId,
  606. IN VSS_ID providerId
  607. );
  608. // callback to specify that the volume snaphost service is shutting down. Used
  609. // by alternative writers to signal when to shutdown.
  610. __declspec(dllexport)
  611. virtual bool STDMETHODCALLTYPE OnVSSShutdown();
  612. // callback to an alternative writer when the application writer subscribes. Used to
  613. // signal the alternative writer to shutdown.
  614. __declspec(dllexport)
  615. virtual bool STDMETHODCALLTYPE OnVSSApplicationStartup();
  616. private:
  617. IVssWriterImpl *m_pWrapper;
  618. };
  619. //
  620. // MessageId: VSS_E_WRITERERROR_INCONSISTENTSNAPSHOT
  621. //
  622. // MessageText:
  623. //
  624. // indicates that the snapshot contains only a subset of the
  625. // volumes needed to correctly backup an application component
  626. //
  627. const HRESULT VSS_E_WRITERERROR_INCONSISTENTSNAPSHOT = (0x800423f0L);
  628. //
  629. // MessageId: VSS_E_WRITERERROR_OUTOFRESOURCES
  630. //
  631. // MessageText:
  632. //
  633. // indicates that the writer failed due to an out of memory,
  634. // out of handles, or other resource allocation failure
  635. //
  636. const HRESULT VSS_E_WRITERERROR_OUTOFRESOURCES = (0x800423f1L);
  637. //
  638. // MessageId: VSS_E_WRITERERROR_TIMEOUT
  639. //
  640. // MessageText:
  641. //
  642. // indicates that the writer failed due to a timeout between
  643. // freeze and thaw.
  644. //
  645. const HRESULT VSS_E_WRITERERROR_TIMEOUT = (0x800423f2L);
  646. //
  647. // MessageId: VSS_E_WRITERERROR_RETRYABLE
  648. //
  649. // MessageText:
  650. //
  651. // indicates that the writer failed due to an error
  652. // that might not occur if another snapshot is created
  653. //
  654. const HRESULT VSS_E_WRITERERROR_RETRYABLE = (0x800423f3L);
  655. //
  656. // MessageId: VSS_E_WRITERERROR_NONRETRYABLE
  657. //
  658. // MessageText:
  659. //
  660. // indicates that the writer failed due to an error
  661. // that most likely would occur if another snapshot is created
  662. //
  663. const HRESULT VSS_E_WRITERERROR_NONRETRYABLE = (0x800423f4L);
  664. //
  665. // MessageId: VSS_E_WRITERERROR_RECOVERY_FAILED
  666. //
  667. // MessageText:
  668. //
  669. // indicates that auto recovery of the snapshot volume failed
  670. const HRESULT VSS_E_WRITERERROR_RECOVERY_FAILED = (0x800423f5L);
  671. #endif //__CVSS_WRITER_H_