summaryrefslogtreecommitdiff
path: root/lib/ShadowCopy/LockFile.cpp
diff options
context:
space:
mode:
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