5 // Copyright transferred from MATRIX-Computer GmbH to
6 // Kern Sibbald by express permission.
9 * Author : Thorsten Engel
10 * Created On : Fri May 06 21:44:00 2006
13 Bacula® - The Network Backup Solution
15 Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
17 The main author of Bacula is Kern Sibbald, with contributions from
18 many others, a complete list can be found in the file AUTHORS.
19 This program is Free Software; you can redistribute it and/or
20 modify it under the terms of version two of the GNU General Public
21 License as published by the Free Software Foundation and included
24 This program is distributed in the hope that it will be useful, but
25 WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 General Public License for more details.
29 You should have received a copy of the GNU General Public License
30 along with this program; if not, write to the Free Software
31 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
34 Bacula® is a registered trademark of John Walker.
35 The licensor of Bacula is the Free Software Foundation Europe
36 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
37 Switzerland, email:ftf@fsfeurope.org.
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 extern VSSClient *g_pVSSClient;
131 #endif /* WIN32_VSS */
133 #endif /* __VSS_H_ */