Fix Windows AccessViolationException in FileSystemWatcher when monitoring network...
authorCarlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Fri, 18 Sep 2020 23:01:58 +0000 (16:01 -0700)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 23:01:58 +0000 (16:01 -0700)
commit2a1735b162437bb35a112014092a834c2496c3e3
treee3688803a2af0afc774e198628e46fa8b49d1be0
parent22d206cb1924ce610d904c6b7f59d5c39c0d3784
Fix Windows AccessViolationException in FileSystemWatcher when monitoring network share for changes (#42419)

* Fix FileSystemWatcher crash due to malformed data coming from Windows.

* Address PR suggestions.

* Bring back assert for numBytes.

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Win32.cs