https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ce7f9211a0620300515f62cc359b3c55909951d8

commit ce7f9211a0620300515f62cc359b3c55909951d8
Author:     Pierre Schweitzer <[email protected]>
AuthorDate: Sun Nov 25 09:32:30 2018 +0100
Commit:     Pierre Schweitzer <[email protected]>
CommitDate: Sun Nov 25 09:32:30 2018 +0100

    [TCPIP] In InfoTdiQueryGetConnectionTcpTable(), only return if there's a 
connection
---
 drivers/network/tcpip/tcpip/ninfo.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/network/tcpip/tcpip/ninfo.c 
b/drivers/network/tcpip/tcpip/ninfo.c
index 74d5b86266..5b7c706b8f 100644
--- a/drivers/network/tcpip/tcpip/ninfo.c
+++ b/drivers/network/tcpip/tcpip/ninfo.c
@@ -186,7 +186,7 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE 
AddrFile,
 {
     SIZE_T Size;
     MIB_TCPROW_OWNER_PID TcpRow;
-    TDI_STATUS Status = TDI_SUCCESS;
+    TDI_STATUS Status = TDI_INVALID_REQUEST;
 
     TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
 
@@ -211,6 +211,8 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE 
AddrFile,
         TcpRow.dwLocalPort = AddrFile->Port;
         TcpRow.dwRemoteAddr = EndPoint->Address.Address.IPv4Address;
         TcpRow.dwRemotePort = EndPoint->Port;
+
+        Status = TDI_SUCCESS;
     }
     else if (AddrFile->Connection != NULL &&
              AddrFile->Connection->SocketContext != NULL)
@@ -238,12 +240,6 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE 
AddrFile,
             }
         }
     }
-    else
-    {
-        TcpRow.dwState = 0;
-        TcpRow.dwRemoteAddr = 0;
-        TcpRow.dwRemotePort = 0;
-    }
 
     if (NT_SUCCESS(Status))
     {

Reply via email to