From ee1c8c5c25d25dfa42120125a8a45dc9831ee412 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:23:48 +0200 Subject: 5.14 --- lib/ShadowCopy/shadow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/ShadowCopy/shadow.cpp') diff --git a/lib/ShadowCopy/shadow.cpp b/lib/ShadowCopy/shadow.cpp index 65387f3b..4f6881ad 100644 --- a/lib/ShadowCopy/shadow.cpp +++ b/lib/ShadowCopy/shadow.cpp @@ -88,25 +88,25 @@ shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError } } - ZEN_CHECK_COM(backupComp->InitializeForBackup()); //throw ComError - ZEN_CHECK_COM(backupComp->SetBackupState(false, false, VSS_BT_FULL)); //throw ComError + ZEN_COM_CHECK(backupComp->InitializeForBackup()); //throw ComError + ZEN_COM_CHECK(backupComp->SetBackupState(false, false, VSS_BT_FULL)); //throw ComError auto waitForComFuture = [](IVssAsync& fut) { - ZEN_CHECK_COM(fut.Wait()); + ZEN_COM_CHECK(fut.Wait()); HRESULT hr = S_OK; - ZEN_CHECK_COM(fut.QueryStatus(&hr, nullptr)); //check if the async operation succeeded... + ZEN_COM_CHECK(fut.QueryStatus(&hr, nullptr)); //check if the async operation succeeded... if (FAILED(hr)) throw ComError(L"Error calling \"fut->QueryStatus\".", hr); }; ComPtr gatherAsync; - ZEN_CHECK_COM(backupComp->GatherWriterMetadata(gatherAsync.init())); + ZEN_COM_CHECK(backupComp->GatherWriterMetadata(gatherAsync.init())); waitForComFuture(*gatherAsync); //failure can happen if XP-version of VSS is used on Windows Vista (which needs at least VSS-Server2003 build) VSS_ID snapshotSetId = {}; - ZEN_CHECK_COM(backupComp->StartSnapshotSet(&snapshotSetId)); + ZEN_COM_CHECK(backupComp->StartSnapshotSet(&snapshotSetId)); ScopeGuard guardSnapShot = makeGuard([&] { backupComp->AbortBackup(); }); //Quote: "This method must be called if a backup operation terminates after the creation of a //shadow copy set with "StartSnapshotSet" and before "DoSnapshotSet" returns." @@ -127,16 +127,16 @@ shadow::ShadowData createShadowCopy(const wchar_t* volumeName) //throw ComError } ComPtr prepareAsync; - ZEN_CHECK_COM(backupComp->PrepareForBackup(prepareAsync.init())); + ZEN_COM_CHECK(backupComp->PrepareForBackup(prepareAsync.init())); waitForComFuture(*prepareAsync); ComPtr snapshotAsync; - ZEN_CHECK_COM(backupComp->DoSnapshotSet(snapshotAsync.init())); + ZEN_COM_CHECK(backupComp->DoSnapshotSet(snapshotAsync.init())); guardSnapShot.dismiss(); waitForComFuture(*snapshotAsync); VSS_SNAPSHOT_PROP props = {}; - ZEN_CHECK_COM(backupComp->GetSnapshotProperties(SnapShotId, &props)); + ZEN_COM_CHECK(backupComp->GetSnapshotProperties(SnapShotId, &props)); ZEN_ON_SCOPE_EXIT(::VssFreeSnapshotProperties(&props)); //finally: write volume name of newly created shadow copy -- cgit