From 20cbbd0ae533ee93d6e40e33c23319c9c85bc5f3 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Sat, 7 Oct 2017 12:39:01 +0300 Subject: [PATCH] ISMBFileStore: Added MaxReadSize and MaxWriteSize properties --- SMBLibrary/Client/ISMBFileStore.cs | 10 ++++++++++ SMBLibrary/Client/SMB1FileStore.cs | 26 +++++++++++++++++++++----- SMBLibrary/Client/SMB2FileStore.cs | 16 ++++++++++++++++ 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/SMBLibrary/Client/ISMBFileStore.cs b/SMBLibrary/Client/ISMBFileStore.cs index eb522ab..8ecf555 100644 --- a/SMBLibrary/Client/ISMBFileStore.cs +++ b/SMBLibrary/Client/ISMBFileStore.cs @@ -11,5 +11,15 @@ namespace SMBLibrary.Client public interface ISMBFileStore : INTFileStore { NTStatus Disconnect(); + + uint MaxReadSize + { + get; + } + + uint MaxWriteSize + { + get; + } } } diff --git a/SMBLibrary/Client/SMB1FileStore.cs b/SMBLibrary/Client/SMB1FileStore.cs index 51fb0e9..e40b437 100644 --- a/SMBLibrary/Client/SMB1FileStore.cs +++ b/SMBLibrary/Client/SMB1FileStore.cs @@ -479,6 +479,27 @@ namespace SMBLibrary.Client return NTStatus.STATUS_INVALID_SMB; } + private void TrySendMessage(SMB1Command request) + { + m_client.TrySendMessage(request, m_treeID); + } + + public uint MaxReadSize + { + get + { + return m_client.MaxReadSize; + } + } + + public uint MaxWriteSize + { + get + { + return m_client.MaxWriteSize; + } + } + private static ExtendedFileAttributes ToExtendedFileAttributes(FileAttributes fileAttributes) { // We only return flags that can be used with NtCreateFile @@ -493,11 +514,6 @@ namespace SMBLibrary.Client return (extendedFileAttributes & (ExtendedFileAttributes)fileAttributes); } - private void TrySendMessage(SMB1Command request) - { - m_client.TrySendMessage(request, m_treeID); - } - private static FileStatus ToFileStatus(CreateDisposition createDisposition) { switch (createDisposition) diff --git a/SMBLibrary/Client/SMB2FileStore.cs b/SMBLibrary/Client/SMB2FileStore.cs index 730d5eb..d355244 100644 --- a/SMBLibrary/Client/SMB2FileStore.cs +++ b/SMBLibrary/Client/SMB2FileStore.cs @@ -287,6 +287,22 @@ namespace SMBLibrary.Client m_client.TrySendCommand(request); } + public uint MaxReadSize + { + get + { + return m_client.MaxReadSize; + } + } + + public uint MaxWriteSize + { + get + { + return m_client.MaxWriteSize; + } + } + private static FileStatus ToFileStatus(CreateAction createAction) { switch (createAction)