[TCPIP] In InfoTdiQueryGetConnectionTcpTable(), only return if there's a connection
authorPierre Schweitzer <pierre@reactos.org>
Sun, 25 Nov 2018 08:32:30 +0000 (09:32 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 25 Nov 2018 08:32:30 +0000 (09:32 +0100)
drivers/network/tcpip/tcpip/ninfo.c

index 74d5b86..5b7c706 100644 (file)
@@ -186,7 +186,7 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
 {
     SIZE_T Size;
     MIB_TCPROW_OWNER_PID TcpRow;
 {
     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"));
 
 
     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;
         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)
     }
     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))
     {
 
     if (NT_SUCCESS(Status))
     {