+/* Pre-Vista version */
+struct IVssBackupComponentsVTable_old {
+ void *QueryInterface;
+ void *AddRef;
+ ULONG (WINAPI *Release)(IVssBackupComponents *this);
+ void *GetWriterComponentsCount;
+ void *GetWriterComponents;
+ HRESULT (WINAPI *InitializeForBackup)(IVssBackupComponents *this,
+ BSTR bstrXML);
+ HRESULT (WINAPI *SetBackupState)(IVssBackupComponents *this,
+ BOOLEAN bSelectComponents,
+ BOOLEAN bBackupBootableSystemState,
+ VSS_BACKUP_TYPE backupType,
+ BOOLEAN bPartialFileSupport);
+ void *InitializeForRestore;
+ /*void *SetRestoreState;*/ /* New API only */
+ HRESULT (WINAPI *GatherWriterMetadata)(IVssBackupComponents *this,
+ IVssAsync **ppAsync);
+ void *GetWriterMetadataCount;
+ void *GetWriterMetadata;
+ void *FreeWriterMetadata;
+ void *AddComponent;
+ HRESULT (WINAPI *PrepareForBackup)(IVssBackupComponents *this,
+ IVssAsync **ppAsync);
+ void *AbortBackup;
+ void *GatherWriterStatus;
+ void *GetWriterStatusCount;
+ void *FreeWriterStatus;
+ void *GetWriterStatus;
+ void *SetBackupSucceeded;
+ void *SetBackupOptions;
+ void *SetSelectedForRestore;
+ void *SetRestoreOptions;
+ void *SetAdditionalRestores;
+ void *SetPreviousBackupStamp;
+ void *SaveAsXML;
+ void *BackupComplete;
+ void *AddAlternativeLocationMapping;
+ void *AddRestoreSubcomponent;
+ void *SetFileRestoreStatus;
+ /*void *AddNewTarget;*/ /* New API only */
+ /*void *SetRangesFilePath;*/ /* New API only */
+ void *PreRestore;
+ void *PostRestore;
+ HRESULT (WINAPI *SetContext)(IVssBackupComponents *this,
+ LONG lContext);
+ HRESULT (WINAPI *StartSnapshotSet)(IVssBackupComponents *this,
+ VSS_ID *pSnapshotSetId);
+ HRESULT (WINAPI *AddToSnapshotSet)(IVssBackupComponents *this,
+ VSS_PWSZ pwszVolumeName,
+ VSS_ID ProviderId,
+ VSS_ID *pidSnapshot);
+ HRESULT (WINAPI *DoSnapshotSet)(IVssBackupComponents *this,
+ IVssAsync **ppAsync);
+ void *DeleteSnapshots;
+ void *ImportSnapshots;
+ void *RemountReadWrite;
+ void *BreakSnapshotSet;
+ HRESULT (WINAPI *GetSnapshotProperties)(IVssBackupComponents *this,
+ VSS_ID SnapshotId,
+ VSS_SNAPSHOT_PROP *pprop);
+ void *Query;
+ void *IsVolumeSupported;
+ void *DisableWriterClasses;
+ void *EnableWriterClasses;
+ void *DisableWriterInstances;
+ void *ExposeSnapshot;
+ /*void *RevertToSnapshot;*/ /* New API only */
+ /*void *QueryRevertStatus;*/ /* New API only */
+};
+
+/* Call a method, assuming its signature is identical in the old and new APIs */
+#define CALL_METHOD(obj, method, ...) \
+({ \
+ HRESULT res; \
+ if (is_old_api) \
+ res = (obj)->old_vtable->method((obj), ##__VA_ARGS__); \
+ else \
+ res = (obj)->vtable->method((obj), ##__VA_ARGS__); \
+ res; \
+})
+