Commit e78ac471 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

iphlpapi: Add support for TCP_TABLE_OWNER_PID_ALL in GetExtendedTcpTable.

parent d1b6cf93
......@@ -1883,15 +1883,35 @@ DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder,
ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved)
{
DWORD ret, size;
void *table;
TRACE("pTcpTable %p, pdwSize %p, bOrder %d, ulAf %u, TableClass %u, Reserved %u\n",
pTcpTable, pdwSize, bOrder, ulAf, TableClass, Reserved);
if (ulAf == AF_INET6 || TableClass != TCP_TABLE_BASIC_ALL)
if (!pdwSize) return ERROR_INVALID_PARAMETER;
if (ulAf != AF_INET ||
(TableClass != TCP_TABLE_BASIC_ALL && TableClass != TCP_TABLE_OWNER_PID_ALL))
{
FIXME("ulAf = %u, TableClass = %u not supportted\n", ulAf, TableClass);
FIXME("ulAf = %u, TableClass = %u not supported\n", ulAf, TableClass);
return ERROR_NOT_SUPPORTED;
}
return GetTcpTable(pTcpTable, pdwSize, bOrder);
if ((ret = build_tcp_table(TableClass, &table, bOrder, GetProcessHeap(), 0, &size)))
return ret;
if (!pTcpTable || *pdwSize < size)
{
*pdwSize = size;
ret = ERROR_INSUFFICIENT_BUFFER;
}
else
{
*pdwSize = size;
memcpy(pTcpTable, table, size);
}
HeapFree(GetProcessHeap(), 0, table);
return ret;
}
/******************************************************************
......
......@@ -37,4 +37,6 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOr
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;
DWORD build_tcp_table(TCP_TABLE_CLASS, void **, BOOL, HANDLE, DWORD, DWORD *) DECLSPEC_HIDDEN;
#endif /* ndef WINE_IPSTATS_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment