summaryrefslogtreecommitdiff
path: root/lib/ShadowCopy
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:19 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:19 +0200
commit0887aee8c54d0ed51bb2031431e2bcdafebb4c6e (patch)
tree69537ceb9787bb25ac363cc4e6cdaf0804d78363 /lib/ShadowCopy
parent5.12 (diff)
downloadFreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.tar.gz
FreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.tar.bz2
FreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.zip
5.13
Diffstat (limited to 'lib/ShadowCopy')
-rw-r--r--lib/ShadowCopy/LockFile.cpp43
-rw-r--r--lib/ShadowCopy/shadow.cpp4
2 files changed, 2 insertions, 45 deletions
diff --git a/lib/ShadowCopy/LockFile.cpp b/lib/ShadowCopy/LockFile.cpp
deleted file mode 100644
index a09e7f94..00000000
--- a/lib/ShadowCopy/LockFile.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// **************************************************************************
-// * This file is part of the FreeFileSync project. It is distributed under *
-// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
-// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
-// **************************************************************************
-
-
-#include <string>
-#include <iostream>
-#define WIN32_LEAN_AND_MEAN
-#include "windows.h"
-
-int wmain(int argc, wchar_t* argv[])
-{
- if (argc <= 1)
- {
- std::wcout << "Please enter the filename to be locked as %1 parameter!" << "\n\n";
- system("pause");
- return -1;
- }
- std::wstring filename = argv[1];
-
- HANDLE hFile = ::CreateFile(filename.c_str(),
- GENERIC_READ,
- 0, //obtain *exclusive* lock on test file
- nullptr,
- OPEN_EXISTING,
- FILE_FLAG_BACKUP_SEMANTICS,
- nullptr);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- std::wcout << "Error obtaining exclusive lock on test file: " << filename << "\n\n";
- system("pause");
- return -1;
- }
-
- std::wcout << "File " << filename << " is locked! Press a key to unlock." << "\n\n";
- system("pause");
-
- ::CloseHandle(hFile);
- return 0;
-}
-
diff --git a/lib/ShadowCopy/shadow.cpp b/lib/ShadowCopy/shadow.cpp
index 93026039..65387f3b 100644
--- a/lib/ShadowCopy/shadow.cpp
+++ b/lib/ShadowCopy/shadow.cpp
@@ -151,8 +151,8 @@ shadow::ShadowHandle shadow::createShadowCopy(const wchar_t* volumeName)
{
try
{
- ShadowData result = ::createShadowCopy(volumeName); //shadow handle owned by caller! throw ComError
- return new ShadowData(result); //std::bad_alloc?
+ ShadowData result = ::createShadowCopy(volumeName); //throw ComError
+ return new ShadowData(result); //shadow handle owned by caller! std::bad_alloc?
}
catch (const zen::ComError& e)
{
bgstack15