summaryrefslogtreecommitdiff
path: root/lib/ShadowCopy/LockFile.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /lib/ShadowCopy/LockFile.cpp
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'lib/ShadowCopy/LockFile.cpp')
-rw-r--r--lib/ShadowCopy/LockFile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ShadowCopy/LockFile.cpp b/lib/ShadowCopy/LockFile.cpp
index b9008863..aac4c170 100644
--- a/lib/ShadowCopy/LockFile.cpp
+++ b/lib/ShadowCopy/LockFile.cpp
@@ -20,10 +20,9 @@ int wmain(int argc, wchar_t* argv[])
}
std::wstring filename = argv[1];
- //obtain exclusive lock on test file
HANDLE hFile = ::CreateFile(filename.c_str(),
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
+ GENERIC_READ,
+ 0, //obtain *exclusive* lock on test file
nullptr,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS,
bgstack15