Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with ReadDirectoryChangesW API on Win32 when buffer overflows #164

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

r00tcxx
Copy link
Contributor

@r00tcxx r00tcxx commented Aug 26, 2023

On Win32, when using the ReadDirectoryChangesW API to monitor file system changes, if the buffer used to receive system change messages overflows, ReadDirectoryChangesW will still return true but will discard all the content of the buffer. In this case, the lpBytesReturned parameter will be zero. If ReadDirectoryChangesW is not called again after this, we can no longer get new change information.

@r00tcxx
Copy link
Contributor Author

r00tcxx commented Aug 26, 2023

This issue becomes particularly evident when recursively monitoring an NTFS volume. Once the buffer overflows, the entire monitoring system ceases to function.

@SpartanJ SpartanJ self-requested a review August 26, 2023 16:54
@SpartanJ SpartanJ merged commit 19398b8 into SpartanJ:master Aug 26, 2023
3 checks passed
@SpartanJ
Copy link
Owner

Thanks for your contribution! Also: you can enlarge the buffer size for that buffer with the new WatcherOption's (WinBufferSize).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants