瀏覽代碼

RPCPipeStream: Treat the bytes written to the pipe as a single message unit

Tal Aloni 7 年之前
父節點
當前提交
e22423c8c1
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      SMBLibrary/Services/RPCPipeStream.cs

+ 3 - 8
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)