summaryrefslogtreecommitdiff
path: root/shared/shadow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shared/shadow.cpp')
-rw-r--r--shared/shadow.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/shared/shadow.cpp b/shared/shadow.cpp
index be0f7c85..81f19d20 100644
--- a/shared/shadow.cpp
+++ b/shared/shadow.cpp
@@ -12,6 +12,7 @@
#include <stdexcept>
#include "staticAssert.h"
#include "buildInfo.h"
+#include "ShadowCopy\shadow.h"
using FreeFileSync::ShadowCopy;
@@ -86,9 +87,10 @@ ShadowCopy::~ShadowCopy()
{
if (backupHandle != NULL)
{
- typedef void (*ReleaseShadowCopyFct)(void* backupHandle);
+ using namespace Shadow;
+
static const ReleaseShadowCopyFct releaseShadowCopy =
- Utility::loadDllFunction<ReleaseShadowCopyFct>(getShadowDllName().c_str(), "releaseShadowCopy");
+ Utility::loadDllFunction<ReleaseShadowCopyFct>(getShadowDllName().c_str(), releaseShadowCopyFctName);
if (releaseShadowCopy == NULL)
throw std::logic_error("Could not load \"releaseShadowCopy\"!"); //shouldn't arrive here!
@@ -100,22 +102,13 @@ ShadowCopy::~ShadowCopy()
Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile)
{
- typedef bool (*CreateShadowCopyFct)( //volumeName must end with "\", while shadowVolName does not end with "\"
- const wchar_t* volumeName,
- wchar_t* shadowVolName,
- unsigned int shadowBufferLen,
- void** backupHandle,
- wchar_t* errorMessage,
- unsigned int errorBufferLen);
- static const CreateShadowCopyFct createShadowCopy =
- Utility::loadDllFunction<CreateShadowCopyFct>(getShadowDllName().c_str(), "createShadowCopy");
+ using namespace Shadow;
+ static const CreateShadowCopyFct createShadowCopy =
+ Utility::loadDllFunction<CreateShadowCopyFct>(getShadowDllName().c_str(), createShadowCopyFctName);
- typedef void (*ReleaseShadowCopyFct)(void* backupHandle);
static const ReleaseShadowCopyFct releaseShadowCopy =
- Utility::loadDllFunction<ReleaseShadowCopyFct>(getShadowDllName().c_str(), "releaseShadowCopy");
-
-
+ Utility::loadDllFunction<ReleaseShadowCopyFct>(getShadowDllName().c_str(), releaseShadowCopyFctName);
//check if shadow copy dll was loaded correctly
if ( createShadowCopy == NULL ||
bgstack15