[IPHLPAPI] Fix checking entity when enumerating TCP/UDP connections
authorPierre Schweitzer <pierre@reactos.org>
Tue, 20 Nov 2018 21:12:47 +0000 (22:12 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Tue, 20 Nov 2018 21:14:25 +0000 (22:14 +0100)
This fixes the API not to return the current TCP connections while
enumerating them (and thus, netstat not displaying them).
It seems we return garbage for now though

dll/win32/iphlpapi/ipstats_reactos.c

index 242626e..d8ec38f 100644 (file)
@@ -611,7 +611,7 @@ DWORD getNumUdpEntries(void)
     status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
 
     for( i = 0; i < numEntities; i++ ) {
-        if( isInterface( &entitySet[i] ) &&
+        if( entitySet[i].tei_entity == CL_TL_ENTITY &&
            hasArp( tcpFile, &entitySet[i] ) ) {
 
            status = tdiGetSetOfThings( tcpFile,
@@ -670,7 +670,7 @@ PMIB_UDPTABLE getUdpTable(void)
     status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
 
     for( i = 0; i < numEntities; i++ ) {
-        if( isInterface( &entitySet[i] ) &&
+        if( entitySet[i].tei_entity == CL_TL_ENTITY &&
            hasArp( tcpFile, &entitySet[i] ) ) {
 
            status = tdiGetSetOfThings( tcpFile,
@@ -721,7 +721,7 @@ DWORD getNumTcpEntries(void)
     status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
 
     for( i = 0; i < numEntities; i++ ) {
-        if( isInterface( &entitySet[i] ) &&
+        if( entitySet[i].tei_entity == CO_TL_ENTITY &&
            hasArp( tcpFile, &entitySet[i] ) ) {
 
            status = tdiGetSetOfThings( tcpFile,
@@ -780,7 +780,7 @@ PMIB_TCPTABLE getTcpTable(void)
     status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
 
     for( i = 0; i < numEntities; i++ ) {
-        if( isInterface( &entitySet[i] ) &&
+        if( entitySet[i].tei_entity == CO_TL_ENTITY &&
            hasArp( tcpFile, &entitySet[i] ) ) {
 
            status = tdiGetSetOfThings( tcpFile,