On Wed, 2013-08-28 at 11:41 +0200, Ralf Habacker wrote:
> diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec
> index 36ba13f..cad2ca9 100644
> --- a/dlls/iphlpapi/iphlpapi.spec
> +++ b/dlls/iphlpapi/iphlpapi.spec
> @@ -6,6 +6,7 @@
> @ stdcall AllocateAndGetIpForwardTableFromStack( ptr long long long )
> @ stdcall AllocateAndGetIpNetTableFromStack( ptr long long long )
> @ stdcall AllocateAndGetTcpTableFromStack( ptr long long long )
> +@ stdcall AllocateAndGetTcpExTableFromStack( ptr long long long )
These should be sorted.
> diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
> index 809dbc6..bcb3021 100644
> --- a/dlls/iphlpapi/ipstats.c
> +++ b/dlls/iphlpapi/ipstats.c
> @@ -2327,6 +2327,32 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack( PMIB_TCPTABLE *ppTcpTable, BOOL bO
> return build_tcp_table( TCP_TABLE_BASIC_ALL, (void **)ppTcpTable, bOrder, heap, flags, NULL );
> }
>
> +/******************************************************************
> + * AllocateAndGetTcpExTableFromStack (IPHLPAPI.@)
> + *
> + * Get the TCP connection table.
> + * Like GetTcpTable(), but allocate the returned table from heap.
> + *
> + * PARAMS
> + * ppTcpTable [Out] pointer into which the MIB_TCPTABLE_EX is
> + * allocated and returned.
> + * bOrder [In] whether to sort the table
> + * heap [In] heap from which the table is allocated
> + * flags [In] flags to HeapAlloc
> + *
> + * RETURNS
> + * ERROR_INVALID_PARAMETER if ppTcpTable is NULL, whatever GetTcpTable()
> + * returns otherwise.
> + */
> +DWORD WINAPI AllocateAndGetTcpExTableFromStack( PMIB_TCPTABLE_EX *ppTcpTable, BOOL bOrder,
> + HANDLE heap, DWORD flags )
> +{
> + TRACE("table %p, bOrder %d, heap %p, flags 0x%08x\n", ppTcpTable, bOrder, heap, flags);
> +
> + if (!ppTcpTable) return ERROR_INVALID_PARAMETER;
> + return build_tcp_table( TCP_TABLE_OWNER_PID_ALL, (void **)ppTcpTable, bOrder, heap, flags, NULL );
> +}
> +
> static DWORD get_udp_table_sizes( UDP_TABLE_CLASS class, DWORD row_count, DWORD *row_size )
> {
> DWORD table_size;
> diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h
> index bf5bb92..823fadb 100644
> --- a/dlls/iphlpapi/ipstats.h
> +++ b/dlls/iphlpapi/ipstats.h
> @@ -34,6 +34,7 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) DECLSPEC_HIDDE
>
> DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
> DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
> +DWORD WINAPI AllocateAndGetTcpExTableFromStack(PMIB_TCPTABLE_EX *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
> DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
> DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForwardTable, BOOL bOrder, HANDLE heap, DWORD flags) DECLSPEC_HIDDEN;
You don't need this, AllocateAndGetTcpExTableFromStack can be made static. The first
parameter should be a void ** like in recent versions of iphlpapi.h.
> diff --git a/include/tcpmib.h b/include/tcpmib.h
> index 477500c..bc63c3f 100644
> --- a/include/tcpmib.h
> +++ b/include/tcpmib.h
> @@ -150,6 +150,9 @@ typedef struct _MIB_TCPTABLE2
> MIB_TCPROW2 table[1];
> } MIB_TCPTABLE2, *PMIB_TCPTABLE2;
>
> +typedef MIB_TCPROW_OWNER_PID _MIB_TCPROW_EX;
> +typedef MIB_TCPTABLE_OWNER_PID MIB_TCPTABLE_EX;
> +typedef PMIB_TCPTABLE_OWNER_PID PMIB_TCPTABLE_EX;
Recent headers don't define these so we shouldn't either.