[TCPIP] Implement enumerating TCP connections with owner PID
[reactos.git] / drivers / network / tcpip / tcpip / info.c
index e642bf1..e29d415 100644 (file)
@@ -260,14 +260,19 @@ TDI_STATUS InfoTdiQueryInformationEx(
                      return TDI_INVALID_PARAMETER;
 
               case IP_MIB_ADDRTABLE_ENTRY_ID:
-                 if (ID->toi_entity.tei_entity != CL_NL_ENTITY && 
-                     ID->toi_entity.tei_entity != CO_NL_ENTITY)
-                     return TDI_INVALID_PARAMETER;
-
                  if (ID->toi_type != INFO_TYPE_PROVIDER)
                      return TDI_INVALID_PARAMETER;
 
-                 return InfoTdiQueryGetAddrTable(ID->toi_entity, Buffer, BufferSize);
+                 if (ID->toi_entity.tei_entity == CL_NL_ENTITY ||
+                     ID->toi_entity.tei_entity == CO_NL_ENTITY)
+                    return InfoTdiQueryGetAddrTable(ID->toi_entity, Buffer, BufferSize);
+                else if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
+                     if ((EntityListContext = GetContext(ID->toi_entity)))
+                         return InfoTdiQueryGetConnectionTcpTable(EntityListContext, Buffer, BufferSize, TRUE);
+                     else
+                         return TDI_INVALID_PARAMETER;
+                else
+                    return TDI_INVALID_PARAMETER;
 
               case IP_MIB_ARPTABLE_ENTRY_ID:
                  if (ID->toi_type != INFO_TYPE_PROVIDER)
@@ -287,7 +292,7 @@ TDI_STATUS InfoTdiQueryInformationEx(
                          return TDI_INVALID_PARAMETER;
                  else if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
                      if ((EntityListContext = GetContext(ID->toi_entity)))
-                         return InfoTdiQueryGetConnectionTcpTable(EntityListContext, Buffer, BufferSize);
+                         return InfoTdiQueryGetConnectionTcpTable(EntityListContext, Buffer, BufferSize, FALSE);
                      else
                          return TDI_INVALID_PARAMETER;
                  else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)