summaryrefslogtreecommitdiff
path: root/library/ShadowCopy/shadow.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:03:20 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:03:20 +0200
commit528635604eea1d8c679a3d038e2f00030ef72444 (patch)
tree9c3cbec29aa7d3e209939662e040b9342c9e7400 /library/ShadowCopy/shadow.cpp
parent3.1 (diff)
downloadFreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.gz
FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.bz2
FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.zip
3.2
Diffstat (limited to 'library/ShadowCopy/shadow.cpp')
-rw-r--r--library/ShadowCopy/shadow.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/library/ShadowCopy/shadow.cpp b/library/ShadowCopy/shadow.cpp
index edc62e8b..cbc4b085 100644
--- a/library/ShadowCopy/shadow.cpp
+++ b/library/ShadowCopy/shadow.cpp
@@ -2,9 +2,20 @@
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
-#include "inc/vss.h"
-#include "inc/vswriter.h"
-#include "inc/vsbackup.h"
+
+#ifdef USE_SHADOW_XP
+#include "xp/inc/vss.h"
+#include "xp/inc/vswriter.h"
+#include "xp/inc/vsbackup.h"
+
+#elif defined USE_SHADOW_2003
+#include "Server 2003/inc/vss.h"
+#include "Server 2003/inc/vswriter.h"
+#include "Server 2003/inc/vsbackup.h"
+#else
+adapt!
+#endif
+
#include <algorithm>
#include <string>
#include <cstdio>
@@ -15,7 +26,7 @@
void writeString(const wchar_t* input, wchar_t* output, unsigned int outputBufferLen)
{
- const unsigned int newSize = min(wcslen(input) + 1, outputBufferLen); //including null-termination
+ const size_t newSize = min(wcslen(input) + 1, outputBufferLen); //including null-termination
memcpy(output, input, newSize * sizeof(wchar_t));
}
@@ -73,10 +84,9 @@ bool shadow::createShadowCopy(const wchar_t* volumeName,
IVssAsync* pWriteMetaData = NULL;
if (FAILED(hr = pBackupComponents->GatherWriterMetadata( &pWriteMetaData )))
- {
+ { //this can happen if XP-version of VSS is used on Windows Vista (which needs at least VSS-Server2003 build)
releaseShadowCopy(pBackupComponents);
- writeErrorMsg(L"\"Shadow.dll\" might be incompatible with this Operating System!\n\
- Error calling \"GatherWriterMetadata\".", hr, errorMessage, errorBufferLen);
+ writeErrorMsg(L"Error calling \"GatherWriterMetadata\".", hr, errorMessage, errorBufferLen);
return false;
}
bgstack15