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;
68 IUnknown* m_pVssObject;
69 GUID m_uidCurrentSnapshotSet;
70 // TRUE if we are during restore
71 BOOL m_bDuringRestore;
72 BOOL m_bBackupIsInitialized;
74 // drive A will be stored on position 0,Z on pos. 25
75 WCHAR m_wszUniqueVolumeName[26][MAX_PATH]; // approx. 7 KB
76 char /* in utf-8 */ m_szShadowCopyName[26][MAX_PATH*2]; // approx. 7 KB
78 void* m_pVectorWriterStates;
79 void* m_pVectorWriterInfo;
82 class VSSClientXP:public VSSClient
86 virtual ~VSSClientXP();
87 virtual BOOL CreateSnapshots(char* szDriveLetters);
88 virtual BOOL CloseBackup();
89 virtual const char* GetDriverName() { return "VSS WinXP"; };
91 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
92 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
93 virtual void QuerySnapshotSet(GUID snapshotSetID);
94 BOOL CheckWriterStatus();
97 class VSSClient2003:public VSSClient
101 virtual ~VSSClient2003();
102 virtual BOOL CreateSnapshots(char* szDriveLetters);
103 virtual BOOL CloseBackup();
104 virtual const char* GetDriverName() { return "VSS Win 2003"; };
106 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
107 virtual void WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
108 virtual void QuerySnapshotSet(GUID snapshotSetID);
109 BOOL CheckWriterStatus();
112 #endif /* WIN32_VSS */
114 #endif /* __VSS_H_ */