Skip to content

Commit 9a72a29

Browse files
authored
Use buffer.Length as the source of truth for ReadDirectoryChanges (#73970)
1 parent 2235858 commit 9a72a29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Win32.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private unsafe void Monitor(AsyncReadState state)
158158
continueExecuting = Interop.Kernel32.ReadDirectoryChangesW(
159159
state.DirectoryHandle,
160160
state.Buffer, // the buffer is kept pinned for the duration of the sync and async operation by the PreAllocatedOverlapped
161-
_internalBufferSize,
161+
(uint)state.Buffer.Length,
162162
_includeSubdirectories,
163163
(uint)_notifyFilters,
164164
null,

0 commit comments

Comments
 (0)