getoverlappedresult

Why is GetOverlappedResult giving 0 bytes result for ReadDirectoryChangesW?

荒凉一梦 提交于 2020-03-05 05:08:06
问题 I have written a file system watcher for our project. Suddenly, it stopped getting events properly. I found out, that after GetOverlappedResult returns true, the result data are empty and so is bytes returned. This is how I create file handle for watching a directory: _directoryHandle = ::CreateFileA("some path", FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL); This is how I start

ReadDirectoryChangesW only places single event in the FILE_NOTIFY_INFORMATION buffer

血红的双手。 提交于 2020-01-25 06:56:06
问题 I have a problem that ReadDirectoryChangesW keeps missing events. I did a lot of googling and the bellow function arguments seem correct according to my searches, but nobody knows for certain. I start watching like this. BOOL _watchRequestResult = false; OVERLAPPED _ovl = { 0 }; _ovl.hEvent = ::CreateEventA(NULL, TRUE, FALSE, NULL); _directoryHandle = ::CreateFileA("some path here", FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG