From c0bb6b5bd611885d9576a01c6cc57a2c8d205640 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 14 Jul 2008 15:55:48 +0000 Subject: [PATCH] * include/iphlpapi.h (GetExtendedTcpTable): Add prototype. * include/iprtrmib.h (TCP_TABLE_CLASS, MIB_TCPROW_OWNER_PID, MIB_TCPTABLE_OWNER_PID, MIB_TCP6ROW_OWNER_PID, MIB_TCP6TABLE_OWNER_PID): Define. * lib/iphlpapi.def (GetExtendedTcpTable): Export. --- winsup/w32api/ChangeLog | 8 +++++++ winsup/w32api/include/iphlpapi.h | 3 +++ winsup/w32api/include/iprtrmib.h | 37 ++++++++++++++++++++++++++++++++ winsup/w32api/lib/iphlpapi.def | 1 + 4 files changed, 49 insertions(+) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index a35405e5b..d478254fc 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,11 @@ +2008-07-14 Corinna Vinschen + + * include/iphlpapi.h (GetExtendedTcpTable): Add prototype. + * include/iprtrmib.h (TCP_TABLE_CLASS, MIB_TCPROW_OWNER_PID, + MIB_TCPTABLE_OWNER_PID, MIB_TCP6ROW_OWNER_PID, + MIB_TCP6TABLE_OWNER_PID): Define. + * lib/iphlpapi.def (GetExtendedTcpTable): Export. + 2008-06-25 Brandon Sneed * include/winbase.h (GetProcessHandleCount, GetSystemRegistryQuota, diff --git a/winsup/w32api/include/iphlpapi.h b/winsup/w32api/include/iphlpapi.h index 6fd976af4..c35c4950d 100644 --- a/winsup/w32api/include/iphlpapi.h +++ b/winsup/w32api/include/iphlpapi.h @@ -37,6 +37,9 @@ DWORD WINAPI GetAdapterIndex(LPWSTR,PULONG); DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO,PULONG); DWORD WINAPI GetBestInterface(IPAddr,PDWORD); DWORD WINAPI GetBestRoute(DWORD,DWORD,PMIB_IPFORWARDROW); +#if (_WIN32_WINNT >= 0x0501) +DWORD WINAPI GetExtendedTcpTable (PVOID,PDWORD,BOOL,ULONG,TCP_TABLE_CLASS,ULONG); +#endif DWORD WINAPI GetFriendlyIfIndex(DWORD); DWORD WINAPI GetIcmpStatistics(PMIB_ICMP); DWORD WINAPI GetIfEntry(PMIB_IFROW); diff --git a/winsup/w32api/include/iprtrmib.h b/winsup/w32api/include/iprtrmib.h index f897ecbfa..3b32f45b9 100644 --- a/winsup/w32api/include/iprtrmib.h +++ b/winsup/w32api/include/iprtrmib.h @@ -39,6 +39,17 @@ extern "C" { #define MIB_USE_CURRENT_TTL ((DWORD)-1) #define MIB_USE_CURRENT_FORWARDING ((DWORD)-1) #define MIB_TCP_MAXCONN_DYNAMIC ((DWORD)-1) +typedef enum { + TCP_TABLE_BASIC_LISTENER, + TCP_TABLE_BASIC_CONNECTIONS, + TCP_TABLE_BASIC_ALL, + TCP_TABLE_OWNER_PID_LISTENER, + TCP_TABLE_OWNER_PID_CONNECTIONS, + TCP_TABLE_OWNER_PID_ALL, + TCP_TABLE_OWNER_MODULE_LISTENER, + TCP_TABLE_OWNER_MODULE_CONNECTIONS, + TCP_TABLE_OWNER_MODULE_ALL +} TCP_TABLE_CLASS, *PTCP_TABLE_CLASS; typedef struct { DWORD dwAddr; DWORD dwIndex; @@ -188,6 +199,18 @@ typedef struct { DWORD dwNumEntries; MIB_TCPROW table[ANY_SIZE]; } MIB_TCPTABLE, *PMIB_TCPTABLE; +typedef struct { + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; +} MIB_TCPROW_OWNER_PID, *PMIB_TCPROW_OWNER_PID; +typedef struct { + DWORD dwNumEntries; + MIB_TCPROW_OWNER_PID table[ANY_SIZE]; +} MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID; typedef struct { DWORD dwInDatagrams; DWORD dwNoPorts; @@ -203,6 +226,20 @@ typedef struct { DWORD dwNumEntries; MIB_UDPROW table[ANY_SIZE]; } MIB_UDPTABLE, *PMIB_UDPTABLE; +typedef struct { + UCHAR ucLocalAddr[16]; + DWORD dwLocalScopeId; + DWORD dwLocalPort; + UCHAR ucRemoteAddr[16]; + DWORD dwRemoteScopeId; + DWORD dwRemotePort; + DWORD dwState; + DWORD dwOwningPid; +} MIB_TCP6ROW_OWNER_PID, *PMIB_TCP6ROW_OWNER_PID; +typedef struct { + DWORD dwNumEntries; + MIB_TCP6ROW_OWNER_PID table[ANY_SIZE]; +} MIB_TCP6TABLE_OWNER_PID, *PMIB_TCP6TABLE_OWNER_PID; #ifdef __cplusplus } #endif diff --git a/winsup/w32api/lib/iphlpapi.def b/winsup/w32api/lib/iphlpapi.def index 6fccc64b3..e01624382 100644 --- a/winsup/w32api/lib/iphlpapi.def +++ b/winsup/w32api/lib/iphlpapi.def @@ -15,6 +15,7 @@ GetAdapterIndex@8 GetAdaptersInfo@8 GetBestInterface@8 GetBestRoute@12 +GetExtendedTcpTable@24 GetFriendlyIfIndex@4 GetIcmpStatistics@4 GetIfEntry@4