5 // Copyright transferred from MATRIX-Computer GmbH to
6 // Kern Sibbald by express permission.
8 // Copyright (C) 2005 Kern Sibbald
10 // This program is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU General Public License
12 // version 2 as amended with additional clauses defined in the
13 // file LICENSE in the main source directory.
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // the file LICENSE for additional details.
23 * Author : Thorsten Engel
24 * Created On : Fri May 06 21:44:00 2006
31 #define b_errno_win32 (1<<29)
36 // some forward declarations
46 BOOL InitializeForBackup();
47 virtual BOOL CreateSnapshots(char* szDriveLetters) = 0;
48 virtual BOOL CloseBackup() = 0;
49 virtual const char* GetDriverName() = 0;
50 BOOL GetShadowPath (const char* szFilePath, char* szShadowPath, int nBuflen);
52 const size_t GetWriterCount();
53 const char* GetWriterInfo(size_t nIndex);
54 const int GetWriterState(size_t nIndex);
55 const BOOL IsInitialized() { return m_bBackupIsInitialized; };
58 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore = FALSE) = 0;
59 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync) = 0;
60 virtual void QuerySnapshotSet(GUID snapshotSetID) = 0;
65 BOOL m_bCoInitializeCalled;
66 BOOL m_bCoInitializeSecurityCalled;
69 IUnknown* m_pVssObject;
70 GUID m_uidCurrentSnapshotSet;
71 // TRUE if we are during restore
72 BOOL m_bDuringRestore;
73 BOOL m_bBackupIsInitialized;
75 // drive A will be stored on position 0,Z on pos. 25
76 WCHAR m_wszUniqueVolumeName[26][MAX_PATH]; // approx. 7 KB
77 char /* in utf-8 */ m_szShadowCopyName[26][MAX_PATH*2]; // approx. 7 KB
79 void* m_pVectorWriterStates;
80 void* m_pVectorWriterInfo;
83 class VSSClientXP:public VSSClient
87 virtual ~VSSClientXP();
88 virtual BOOL CreateSnapshots(char* szDriveLetters);
89 virtual BOOL CloseBackup();
90 virtual const char* GetDriverName() { return "VSS WinXP"; };
92 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
93 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
94 virtual void QuerySnapshotSet(GUID snapshotSetID);
95 BOOL CheckWriterStatus();
98 class VSSClient2003:public VSSClient
102 virtual ~VSSClient2003();
103 virtual BOOL CreateSnapshots(char* szDriveLetters);
104 virtual BOOL CloseBackup();
105 virtual const char* GetDriverName() { return "VSS Win 2003"; };
107 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
108 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
109 virtual void QuerySnapshotSet(GUID snapshotSetID);
110 BOOL CheckWriterStatus();
113 #endif /* WIN32_VSS */
115 #endif /* __VSS_H_ */