Skip to content

Commit

Permalink
vss: remove support for older windows versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsura authored and pstorz committed Jun 27, 2023
1 parent 15a1185 commit 68f63f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 86 deletions.
9 changes: 1 addition & 8 deletions core/src/win32/filed/vss.cc
Expand Up @@ -80,14 +80,7 @@ void VSSInit(JobControlRecord* jcr)
{
// Decide which vss class to initialize
if (g_MajorVersion == 5) {
switch (g_MinorVersion) {
case 1:
jcr->fd_impl->pVSSClient = new VSSClientXP();
break;
case 2:
jcr->fd_impl->pVSSClient = new VSSClient2003();
break;
}
Jmsg(jcr, M_FATAL, 0, "Your windows version is not supported anymore.\n");
// Vista or Longhorn or later
} else if (g_MajorVersion >= 6) {
jcr->fd_impl->pVSSClient = new VSSClientVista();
Expand Down
24 changes: 4 additions & 20 deletions core/src/win32/filed/vss_generic.cc
Expand Up @@ -81,26 +81,10 @@ class IXMLDOMDocument;
# undef uuid
# define uuid(x)

# ifdef B_VSS_XP
# define VSSClientGeneric VSSClientXP
# include "WinXP/vss.h"
# include "WinXP/vswriter.h"
# include "WinXP/vsbackup.h"
# endif

# ifdef B_VSS_W2K3
# define VSSClientGeneric VSSClient2003
# include "Win2003/vss.h"
# include "Win2003/vswriter.h"
# include "Win2003/vsbackup.h"
# endif

# ifdef B_VSS_VISTA
# define VSSClientGeneric VSSClientVista
# include "Win2003/vss.h"
# include "Win2003/vswriter.h"
# include "Win2003/vsbackup.h"
# endif
# define VSSClientGeneric VSSClientVista
# include "Win2003/vss.h"
# include "Win2003/vswriter.h"
# include "Win2003/vsbackup.h"

# define VSS_ERROR_OBJECT_ALREADY_EXISTS 0x8004230D

Expand Down
58 changes: 0 additions & 58 deletions core/src/win32/include/vss.h
Expand Up @@ -140,64 +140,6 @@ class VSSClient {
int VMP_snapshots = 0; /* volume mount points that are snapshotted */
};

class VSSClientXP : public VSSClient {
public:
VSSClientXP();
virtual ~VSSClientXP();
virtual void AddVolumeSnapshots(IVssBackupComponents* pVssObj,
const std::vector<std::wstring>& volumes,
bool onefs_disabled) override;
virtual void AddVolumeMountPointSnapshots(IVssBackupComponents* pVssObj,
const std::wstring& volume,
std::unordered_set<std::wstring>& snapshoted_volumes) override;
virtual void ShowVolumeMountPointStats(JobControlRecord* jcr) override;
virtual bool CreateSnapshots(const std::vector<std::wstring>& volumes,
bool onefs_disabled) override;
virtual bool CloseBackup() override;
virtual bool CloseRestore() override;
virtual WCHAR* GetMetadata() override;
# ifdef _WIN64
virtual const char* GetDriverName() override { return "Win64 VSS"; };
# else
virtual const char* GetDriverName() override { return "Win32 VSS"; };
# endif

private:
virtual bool Initialize(DWORD dwContext, bool bDuringRestore) override;
virtual bool WaitAndCheckForAsyncOperation(IVssAsync* pAsync) override;
virtual void QuerySnapshotSet(GUID snapshotSetID) override;
bool CheckWriterStatus();
};

class VSSClient2003 : public VSSClient {
public:
VSSClient2003();
virtual ~VSSClient2003();
virtual void AddVolumeSnapshots(IVssBackupComponents* pVssObj,
const std::vector<std::wstring>& volumes,
bool onefs_disabled) override;
virtual void AddVolumeMountPointSnapshots(IVssBackupComponents* pVssObj,
const std::wstring& volume,
std::unordered_set<std::wstring>& snapshoted_volumes) override;
virtual void ShowVolumeMountPointStats(JobControlRecord* jcr) override;
virtual bool CreateSnapshots(const std::vector<std::wstring>& volumes,
bool onefs_disabled) override;
virtual bool CloseBackup() override;
virtual bool CloseRestore() override;
virtual WCHAR* GetMetadata() override;
# ifdef _WIN64
virtual const char* GetDriverName() override { return "Win64 VSS"; };
# else
virtual const char* GetDriverName() override { return "Win32 VSS"; };
# endif

private:
virtual bool Initialize(DWORD dwContext, bool bDuringRestore) override;
virtual bool WaitAndCheckForAsyncOperation(IVssAsync* pAsync) override;
virtual void QuerySnapshotSet(GUID snapshotSetID) override;
bool CheckWriterStatus();
};

class VSSClientVista : public VSSClient {
public:
VSSClientVista();
Expand Down

0 comments on commit 68f63f3

Please sign in to comment.