From dae8a6b19ed3f9983f05b4bef966f6ed80bd8511 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Thu, 18 May 2017 22:52:13 +0300 Subject: [PATCH] NTFileSystemAdapter: Use read-ahead mechanism unless FILE_NO_INTERMEDIATE_BUFFERING is set or FILE_RANDOM_ACCESS flag is set --- SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs index 0cc6ccd..a4fb74b 100644 --- a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs +++ b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs @@ -256,7 +256,7 @@ namespace SMBLibrary // of a file copy operation (where the caller will attempt to simply copy the reparse point). bool openReparsePoint = (openOptions & CreateOptions.FILE_OPEN_REPARSE_POINT) > 0; bool disableBuffering = (openOptions & CreateOptions.FILE_NO_INTERMEDIATE_BUFFERING) > 0; - bool buffered = (openOptions & CreateOptions.FILE_SEQUENTIAL_ONLY) > 0 && !disableBuffering && !openReparsePoint; + bool buffered = (openOptions & CreateOptions.FILE_RANDOM_ACCESS) == 0 && !disableBuffering && !openReparsePoint; FileShare fileShare = NTFileStoreHelper.ToFileShare(shareAccess); string fileShareString = fileShare.ToString().Replace(", ", "|"); try