Alexandre Julliard : iphlpapi: Remove the no longer needed getNumTcpEntries function.
Alexandre Julliard
julliard at winehq.org
Mon Mar 2 09:01:55 CST 2009
Module: wine
Branch: master
Commit: 18a5a77bacd76d5720b783af93fe6704d215dc78
URL: http://source.winehq.org/git/wine.git/?a=commit;h=18a5a77bacd76d5720b783af93fe6704d215dc78
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Mar 2 12:54:35 2009 +0100
iphlpapi: Remove the no longer needed getNumTcpEntries function.
---
dlls/iphlpapi/ipstats.c | 16 ++++++----------
dlls/iphlpapi/ipstats.h | 3 ---
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 103ef45..c7c08fd 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -693,6 +693,7 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
#else
FILE *fp;
+ MIB_TCPTABLE *tcp_table;
if (!stats)
return ERROR_INVALID_PARAMETER;
@@ -772,7 +773,11 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
stats->dwOutRsts = strtoul(ptr, &endPtr, 10);
ptr = endPtr;
}
- stats->dwNumConns = getNumTcpEntries();
+ if (!AllocateAndGetTcpTableFromStack( &tcp_table, FALSE, GetProcessHeap(), 0 ))
+ {
+ stats->dwNumConns = tcp_table->dwNumEntries;
+ HeapFree( GetProcessHeap(), 0, tcp_table );
+ }
}
}
fclose(fp);
@@ -1565,15 +1570,6 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOr
}
-DWORD getNumTcpEntries(void)
-{
-#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
- return getNumWithOneHeader ("net.inet.tcp.pcblist");
-#else
- return getNumWithOneHeader ("/proc/net/tcp");
-#endif
-}
-
static MIB_TCPTABLE *append_tcp_row( HANDLE heap, DWORD flags, MIB_TCPTABLE *table,
DWORD *count, const MIB_TCPROW *row )
{
diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h
index 2c82981..871fcec 100644
--- a/dlls/iphlpapi/ipstats.h
+++ b/dlls/iphlpapi/ipstats.h
@@ -55,9 +55,6 @@ DWORD getUDPStats(MIB_UDPSTATS *stats);
/* Returns the number of entries in the route table. */
DWORD getNumRoutes(void);
-/* Returns the number of entries in the TCP state table. */
-DWORD getNumTcpEntries(void);
-
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags);
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags);
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags);
More information about the wine-cvs
mailing list