From c2a86a5ddca3c51ee32454bebbdf2e9ce4780f3b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 3 Mar 2010 16:36:30 +0100 Subject: [PATCH] Add James' code to get VssObject --- bacula/src/filed/fd_plugins.c | 8 ++++++++ bacula/src/filed/fd_plugins.h | 8 ++++++-- bacula/src/win32/filed/vss.h | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index df13465431..c864d7a8e8 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -907,6 +907,14 @@ static bRC baculaGetValue(bpContext *ctx, bVariable var, void *value) break; case bVarFileSeen: break; /* a write only variable, ignore read request */ + case bVarVssObject: +#ifdef HAVE_WIN32 + if (g_pVSSClient) { + value = g_pVSSClient->GetVssObject(); + break; + } +#endif + return bRC_Error; } return bRC_OK; } diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index 50ed3dde76..0e95d4640a 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2009 Free Software Foundation Europe e.V. + Copyright (C) 2007-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -66,6 +66,9 @@ #include "bc_types.h" #include "lib/plugins.h" #include +#ifdef HAVE_WIN32 +#include "../win32/filed/vss.h" +#endif /* * This packet is used for file save info transfer. @@ -146,7 +149,8 @@ typedef enum { bVarJobStatus = 7, bVarSinceTime = 8, bVarAccurate = 9, - bVarFileSeen = 10 + bVarFileSeen = 10, + bVarVssObject = 11 } bVariable; /* Events that are passed to plugin */ diff --git a/bacula/src/win32/filed/vss.h b/bacula/src/win32/filed/vss.h index e25de09d97..04ea7acc65 100644 --- a/bacula/src/win32/filed/vss.h +++ b/bacula/src/win32/filed/vss.h @@ -69,6 +69,7 @@ public: void DestroyWriterInfo(); void AppendWriterInfo(int nState, const char* pszInfo); const bool IsInitialized() { return m_bBackupIsInitialized; }; + IUnknown *GetVssObject() { return m_pVssObject; }; private: virtual bool Initialize(DWORD dwContext, bool bDuringRestore = FALSE) = 0; -- 2.39.5