6 // Copyright transferred from MATRIX-Computer GmbH to
7 // Kern Sibbald by express permission.
9 // Copyright (C) 2004-2005 Kern Sibbald
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License as
13 // published by the Free Software Foundation; either version 2 of
14 // the License, or (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // General Public License for more details.
21 // You should have received a copy of the GNU General Public
22 // License along with this program; if not, write to the Free
23 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 // MA 02111-1307, USA.
29 * Author : Thorsten Engel
30 * Created On : Fri May 06 21:44:00 2006
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);
57 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore = FALSE) = 0;
58 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync) = 0;
59 virtual void QuerySnapshotSet(GUID snapshotSetID) = 0;
64 BOOL m_bCoInitializeCalled;
67 IUnknown* m_pVssObject;
68 GUID m_uidCurrentSnapshotSet;
69 // TRUE if we are during restore
70 BOOL m_bDuringRestore;
71 BOOL m_bBackupIsInitialized;
73 // drive A will be stored on position 0,Z on pos. 25
74 WCHAR m_wszUniqueVolumeName[26][MAX_PATH]; // approx. 7 KB
75 char /* in utf-8 */ m_szShadowCopyName[26][MAX_PATH*2]; // approx. 7 KB
77 void* m_pVectorWriterStates;
78 void* m_pVectorWriterInfo;
81 class VSSClientXP:public VSSClient
85 virtual ~VSSClientXP();
86 virtual BOOL CreateSnapshots(char* szDriveLetters);
87 virtual BOOL CloseBackup();
88 virtual const char* GetDriverName() { return "VSS WinXP"; };
90 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
91 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
92 virtual void QuerySnapshotSet(GUID snapshotSetID);
93 BOOL CheckWriterStatus();
96 class VSSClient2003:public VSSClient
100 virtual ~VSSClient2003();
101 virtual BOOL CreateSnapshots(char* szDriveLetters);
102 virtual BOOL CloseBackup();
103 virtual const char* GetDriverName() { return "VSS Win 2003"; };
105 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
106 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
107 virtual void QuerySnapshotSet(GUID snapshotSetID);
108 BOOL CheckWriterStatus();
112 #endif /* __VSS_H_ */