2 Bacula® - The Network Backup Solution
4 Copyright (C) 2006-2007 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version two of the GNU General Public
10 License as published by the Free Software Foundation and included
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of John Walker.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
32 // Copyright transferred from MATRIX-Computer GmbH to
33 // Kern Sibbald by express permission.
36 * Author : Thorsten Engel
37 * Created On : Fri May 06 21:44:00 2006
44 #define b_errno_win32 (1<<29)
49 // some forward declarations
59 BOOL InitializeForBackup();
60 virtual BOOL CreateSnapshots(char* szDriveLetters) = 0;
61 virtual BOOL CloseBackup() = 0;
62 virtual const char* GetDriverName() = 0;
63 BOOL GetShadowPath (const char* szFilePath, char* szShadowPath, int nBuflen);
64 BOOL GetShadowPathW (const wchar_t* szFilePath, wchar_t* szShadowPath, int nBuflen); /* nBuflen in characters */
66 const size_t GetWriterCount();
67 const char* GetWriterInfo(int nIndex);
68 const int GetWriterState(int nIndex);
69 void DestroyWriterInfo();
70 void AppendWriterInfo(int nState, const char* pszInfo);
71 const BOOL IsInitialized() { return m_bBackupIsInitialized; };
74 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore = FALSE) = 0;
75 virtual BOOL WaitAndCheckForAsyncOperation(IVssAsync* pAsync) = 0;
76 virtual void QuerySnapshotSet(GUID snapshotSetID) = 0;
81 BOOL m_bCoInitializeCalled;
82 BOOL m_bCoInitializeSecurityCalled;
85 IUnknown* m_pVssObject;
86 GUID m_uidCurrentSnapshotSet;
87 // TRUE if we are during restore
88 BOOL m_bDuringRestore;
89 BOOL m_bBackupIsInitialized;
91 // drive A will be stored on position 0,Z on pos. 25
92 wchar_t m_wszUniqueVolumeName[26][MAX_PATH]; // approx. 7 KB
93 wchar_t m_szShadowCopyName[26][MAX_PATH]; // approx. 7 KB
95 void* m_pAlistWriterState;
96 void* m_pAlistWriterInfoText;
99 class VSSClientXP:public VSSClient
103 virtual ~VSSClientXP();
104 virtual BOOL CreateSnapshots(char* szDriveLetters);
105 virtual BOOL CloseBackup();
106 virtual const char* GetDriverName() { return "VSS WinXP"; };
108 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
109 virtual BOOL WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
110 virtual void QuerySnapshotSet(GUID snapshotSetID);
111 BOOL CheckWriterStatus();
114 class VSSClient2003:public VSSClient
118 virtual ~VSSClient2003();
119 virtual BOOL CreateSnapshots(char* szDriveLetters);
120 virtual BOOL CloseBackup();
121 virtual const char* GetDriverName() { return "VSS Win 2003"; };
123 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
124 virtual BOOL WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
125 virtual void QuerySnapshotSet(GUID snapshotSetID);
126 BOOL CheckWriterStatus();
129 class VSSClientVista:public VSSClient
133 virtual ~VSSClientVista();
134 virtual BOOL CreateSnapshots(char* szDriveLetters);
135 virtual BOOL CloseBackup();
136 virtual const char* GetDriverName() { return "VSS Vista"; };
138 virtual BOOL Initialize(DWORD dwContext, BOOL bDuringRestore);
139 virtual BOOL WaitAndCheckForAsyncOperation(IVssAsync* pAsync);
140 virtual void QuerySnapshotSet(GUID snapshotSetID);
141 BOOL CheckWriterStatus();
145 extern VSSClient *g_pVSSClient;
147 #endif /* WIN32_VSS */
149 #endif /* __VSS_H_ */