summaryrefslogtreecommitdiff
path: root/zen/dir_watcher.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:09 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:09 +0200
commit110fc5dee14fc7988f631a158e50d283446aba7a (patch)
tree7c19dfd3bdb8c4636409ec80a38c70499ac006db /zen/dir_watcher.cpp
parent5.14 (diff)
downloadFreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.gz
FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.bz2
FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.zip
5.15
Diffstat (limited to 'zen/dir_watcher.cpp')
-rw-r--r--zen/dir_watcher.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp
index 0b34f890..6c6c0929 100644
--- a/zen/dir_watcher.cpp
+++ b/zen/dir_watcher.cpp
@@ -188,6 +188,8 @@ public:
ZEN_ON_SCOPE_EXIT(::CloseHandle(overlapped.hEvent));
+ DWORD bytesReturned = 0; //should not be needed for async calls, still pass it to help broken drivers
+
//asynchronous variant: runs on this thread's APC queue!
if (!::ReadDirectoryChangesW(hDir, // __in HANDLE hDirectory,
&buffer[0], // __out LPVOID lpBuffer,
@@ -197,7 +199,7 @@ public:
FILE_NOTIFY_CHANGE_DIR_NAME |
FILE_NOTIFY_CHANGE_SIZE |
FILE_NOTIFY_CHANGE_LAST_WRITE, // __in DWORD dwNotifyFilter,
- nullptr, // __out_opt LPDWORD lpBytesReturned,
+ &bytesReturned, // __out_opt LPDWORD lpBytesReturned,
&overlapped, // __inout_opt LPOVERLAPPED lpOverlapped,
nullptr)) // __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirnamePf)) + L" (ReadDirectoryChangesW)" L"\n\n" + getLastErrorFormatted(), ::GetLastError());
bgstack15