diff options
Diffstat (limited to 'lib/ShadowCopy')
-rw-r--r-- | lib/ShadowCopy/Shadow_Server2003.vcxproj | 2 | ||||
-rw-r--r-- | lib/ShadowCopy/Shadow_Windows7.vcxproj | 2 | ||||
-rw-r--r-- | lib/ShadowCopy/Shadow_XP.vcxproj | 2 | ||||
-rw-r--r-- | lib/ShadowCopy/shadow.cpp | 22 |
4 files changed, 11 insertions, 17 deletions
diff --git a/lib/ShadowCopy/Shadow_Server2003.vcxproj b/lib/ShadowCopy/Shadow_Server2003.vcxproj index 4622c246..520a4d6d 100644 --- a/lib/ShadowCopy/Shadow_Server2003.vcxproj +++ b/lib/ShadowCopy/Shadow_Server2003.vcxproj @@ -68,10 +68,8 @@ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> diff --git a/lib/ShadowCopy/Shadow_Windows7.vcxproj b/lib/ShadowCopy/Shadow_Windows7.vcxproj index c735371b..1fe769d0 100644 --- a/lib/ShadowCopy/Shadow_Windows7.vcxproj +++ b/lib/ShadowCopy/Shadow_Windows7.vcxproj @@ -68,10 +68,8 @@ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> diff --git a/lib/ShadowCopy/Shadow_XP.vcxproj b/lib/ShadowCopy/Shadow_XP.vcxproj index a5d07786..0d231f3d 100644 --- a/lib/ShadowCopy/Shadow_XP.vcxproj +++ b/lib/ShadowCopy/Shadow_XP.vcxproj @@ -67,10 +67,8 @@ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> - <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">OBJ\$(ProjectName)_$(Configuration)_$(Platform)\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> diff --git a/lib/ShadowCopy/shadow.cpp b/lib/ShadowCopy/shadow.cpp index 4f6881ad..e915663f 100644 --- a/lib/ShadowCopy/shadow.cpp +++ b/lib/ShadowCopy/shadow.cpp @@ -75,7 +75,7 @@ std::wstring formatVssError(HRESULT hr) //at least the one's from IVssBackupComp } -shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError +shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw SysError { ComPtr<IVssBackupComponents> backupComp; { @@ -83,13 +83,13 @@ shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError if (FAILED(hr)) { if (hr == E_ACCESSDENIED) - throw ComError(L"The caller does not have sufficient backup privileges or is not an administrator.", hr); - throw ComError(L"Error calling \"CreateVssBackupComponents\".", hr); + throw SysError(formatComError(L"The caller does not have sufficient backup privileges or is not an administrator.", hr)); + throw SysError(formatComError(L"Error calling \"CreateVssBackupComponents\".", hr)); } } - ZEN_COM_CHECK(backupComp->InitializeForBackup()); //throw ComError - ZEN_COM_CHECK(backupComp->SetBackupState(false, false, VSS_BT_FULL)); //throw ComError + ZEN_COM_CHECK(backupComp->InitializeForBackup()); //throw SysError + ZEN_COM_CHECK(backupComp->SetBackupState(false, false, VSS_BT_FULL)); //throw SysError auto waitForComFuture = [](IVssAsync& fut) { @@ -98,7 +98,7 @@ shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError HRESULT hr = S_OK; ZEN_COM_CHECK(fut.QueryStatus(&hr, nullptr)); //check if the async operation succeeded... if (FAILED(hr)) - throw ComError(L"Error calling \"fut->QueryStatus\".", hr); + throw SysError(formatComError(L"Error calling \"fut->QueryStatus\".", hr)); }; ComPtr<IVssAsync> gatherAsync; @@ -117,12 +117,12 @@ shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError if (FAILED(hr)) { if (hr == VSS_E_VOLUME_NOT_SUPPORTED) - throw ComError(L"Volume Shadow Copy Service is not supported on this volume!"); + throw SysError(L"Volume Shadow Copy Service is not supported on this volume!"); const std::wstring vssError = formatVssError(hr); if (!vssError.empty()) - throw ComError(L"Error calling \"backupComp->AddToSnapshotSet\": " + vssError); + throw SysError(L"Error calling \"backupComp->AddToSnapshotSet\": " + vssError); else - throw ComError(L"Error calling \"backupComp->AddToSnapshotSet\".", hr); + throw SysError(formatComError(L"Error calling \"backupComp->AddToSnapshotSet\".", hr)); } } @@ -151,10 +151,10 @@ shadow::ShadowHandle shadow::createShadowCopy(const wchar_t* volumeName) { try { - ShadowData result = ::createShadowCopy(volumeName); //throw ComError + ShadowData result = ::createShadowCopy(volumeName); //throw SysError return new ShadowData(result); //shadow handle owned by caller! std::bad_alloc? } - catch (const zen::ComError& e) + catch (const zen::SysError& e) { lastErrorMessage.reset(new std::wstring(e.toString())); return nullptr; |