1/* 2 * Copyright 2019 Alistair Leslie-Hughes 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 18 19import "oaidl.idl"; 20import "vswriter.idl"; 21import "vss.idl"; 22 23interface IVssAsync; 24interface IVssEnumObject; 25interface IVssExamineWriterMetadata; 26interface IVssWriterComponentsExt; 27 28cpp_quote("#ifdef _cplusplus") 29cpp_quote("extern \"C\" {") 30cpp_quote("#endif") 31cpp_quote("HRESULT WINAPI CreateVssBackupComponentsInternal(IVssBackupComponents **backup);") 32cpp_quote("#ifdef _cplusplus") 33cpp_quote("}") 34cpp_quote("#endif") 35 36cpp_quote("static inline HRESULT CreateVssBackupComponents(IVssBackupComponents **backup)") 37cpp_quote(" { return CreateVssBackupComponentsInternal(backup); }") 38 39[ 40 uuid("665c1d5f-c218-414d-a05d-7fef5f9d5c86"), 41 local 42] 43interface IVssBackupComponents : IUnknown 44{ 45 HRESULT GetWriterComponentsCount([out] UINT *components); 46 HRESULT GetWriterComponents([in] UINT index, [out] IVssWriterComponentsExt **writer); 47 HRESULT InitializeForBackup( [in, optional, defaultvalue(NULL)] BSTR bstrXML); 48 HRESULT SetBackupState([in] BOOL select_components, [in] BOOL state, 49 [in] VSS_BACKUP_TYPE type, [in, defaultvalue(FALSE)] BOOL partial_support); 50 HRESULT InitializeForRestore([in] BSTR xml); 51 HRESULT SetRestoreState([in] VSS_RESTORE_TYPE restore); 52 HRESULT GatherWriterMetadata([out] IVssAsync **async); 53 HRESULT GetWriterMetadataCount([out] UINT *count); 54 HRESULT GetWriterMetadata([in] UINT index, [out] VSS_ID *instance, [out] IVssExamineWriterMetadata **metadata); 55 HRESULT FreeWriterMetadata(); 56 HRESULT AddComponent([in] VSS_ID instance, [in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR wszLogicalPath, 57 [in] LPCWSTR name); 58 HRESULT PrepareForBackup([out] IVssAsync **async); 59 HRESULT AbortBackup(); 60 HRESULT GatherWriterStatus([out] IVssAsync **async); 61 HRESULT GetWriterStatusCount([out] UINT *count); 62 HRESULT FreeWriterStatus(); 63 HRESULT GetWriterStatus([in] UINT index, [out] VSS_ID *instance, [out] VSS_ID *id, [out] BSTR *writer, 64 [out] VSS_WRITER_STATE *status, [out] HRESULT *failure); 65 HRESULT SetBackupSucceeded([in] VSS_ID instance, [in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, 66 [in] LPCWSTR path, [in] LPCWSTR name, [in] BOOL succeded); 67 HRESULT SetBackupOptions([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, 68 [in] LPCWSTR name, [in] LPCWSTR options); 69 HRESULT SetSelectedForRestore([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, 70 [in] LPCWSTR name, [in] BOOL selected_restore); 71 HRESULT SetRestoreOptions([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, [in] LPCWSTR name, 72 [in] LPCWSTR options); 73 HRESULT SetAdditionalRestores([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, [in] LPCWSTR name, 74 [in] BOOL additional); 75 HRESULT SetPreviousBackupStamp([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, [in] LPCWSTR name, 76 [in] LPCWSTR stamp); 77 HRESULT SaveAsXML([in] BSTR *xml); 78 HRESULT BackupComplete([out] IVssAsync **async); 79 HRESULT AddAlternativeLocationMapping([in] VSS_ID id, [in] VSS_COMPONENT_TYPE type, [in] LPCWSTR logical, 80 [in] LPCWSTR name, [in] LPCWSTR path, [in] LPCWSTR filespec, [in] BOOL recursive, [in] LPCWSTR destination); 81 HRESULT AddRestoreSubcomponent([in] VSS_ID id, [in] VSS_COMPONENT_TYPE type, [in] LPCWSTR logical, [in] LPCWSTR name, 82 [in] LPCWSTR path, [in] LPCWSTR sub_name, [in] BOOL repair); 83 HRESULT SetFileRestoreStatus([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR path, [in] LPCWSTR name, 84 [in] VSS_FILE_RESTORE_STATUS status); 85 HRESULT AddNewTarget([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR logical, [in] LPCWSTR component, 86 [in] LPCWSTR path, [in] LPCWSTR filename, [in] BOOL recursive, [in] LPCWSTR alternate); 87 HRESULT SetRangesFilePath([in] VSS_ID id, [in] VSS_COMPONENT_TYPE ct, [in] LPCWSTR logical, [in] LPCWSTR component, 88 [in] UINT partial, [in] LPCWSTR ranges); 89 HRESULT PreRestore([out] IVssAsync **async); 90 HRESULT PostRestore([out] IVssAsync **async); 91 HRESULT SetContext([in] LONG context); 92 HRESULT StartSnapshotSet([out] VSS_ID *id); 93 HRESULT AddToSnapshotSet([in] VSS_PWSZ volume,[in] VSS_ID id,[out] VSS_ID *snapshot); 94 HRESULT DoSnapshotSet([out] IVssAsync ** async); 95 HRESULT DeleteSnapshots([in] VSS_ID object, [in] VSS_OBJECT_TYPE type, [in] BOOL force, [in] LONG *snapshots, [in] VSS_ID *id); 96 HRESULT ImportSnapshots([out] IVssAsync **async); 97 HRESULT BreakSnapshotSet([in] VSS_ID snapshot); 98 HRESULT GetSnapshotProperties([in] VSS_ID snapshot, [out] VSS_SNAPSHOT_PROP *prop); 99 HRESULT Query([in] VSS_ID queried, [in] VSS_OBJECT_TYPE queried_type, [in] VSS_OBJECT_TYPE returned_type, [in] IVssEnumObject **enums); 100 HRESULT IsVolumeSupported([in] VSS_ID provider, [in] VSS_PWSZ volume,[in] BOOL *supported); 101 HRESULT DisableWriterClasses([in] const VSS_ID *writer_id, [in] UINT class_id); 102 HRESULT EnableWriterClasses([in] const VSS_ID *classid, [in] UINT id); 103 HRESULT DisableWriterInstances([in] const VSS_ID *instance, [in] UINT id); 104 HRESULT ExposeSnapshot([in] VSS_ID snapshot, [in] VSS_PWSZ path, [in] LONG attributes, 105 [in] VSS_PWSZ expose, [out] VSS_PWSZ *exposed); 106 HRESULT RevertToSnapshot([in] VSS_ID snapshot, [in] BOOL force); 107 HRESULT QueryRevertStatus([in] VSS_PWSZ volume, [out] IVssAsync **async); 108}; 109