From e22423c8c184b6f8f7011c0783b0d7cd74f42d0c Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Sat, 9 Sep 2017 09:38:17 +0300 Subject: [PATCH] RPCPipeStream: Treat the bytes written to the pipe as a single message unit --- SMBLibrary/Services/RPCPipeStream.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/SMBLibrary/Services/RPCPipeStream.cs b/SMBLibrary/Services/RPCPipeStream.cs index 8d12fcf..8eda3f6 100644 --- a/SMBLibrary/Services/RPCPipeStream.cs +++ b/SMBLibrary/Services/RPCPipeStream.cs @@ -42,14 +42,9 @@ namespace SMBLibrary.Services public override void Write(byte[] buffer, int offset, int count) { - int lengthOfPDUs = 0; - do - { - RPCPDU rpcRequest = RPCPDU.GetPDU(buffer, offset); - ProcessRPCRequest(rpcRequest); - lengthOfPDUs += rpcRequest.FragmentLength; - } - while (lengthOfPDUs < count); + // [MC-CIFS] In message mode, the system treats the bytes read or written in each I/O operation to the pipe as a message unit. + RPCPDU rpcRequest = RPCPDU.GetPDU(buffer, offset); + ProcessRPCRequest(rpcRequest); } private void ProcessRPCRequest(RPCPDU rpcRequest)