[IPHLPAPI] Fix checking entity when enumerating TCP/UDP connections

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
This commit is contained in:
Pierre Schweitzer 2018-11-20 22:12:47 +01:00
parent f6f1255cf7
commit 8a98c85c1f
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View 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,