iphlpapi: Reimplement GetTcpTable on top of GetExtendedTcpTable.

This commit is contained in:
Hans Leidekker 2012-04-16 12:36:00 +02:00 committed by Alexandre Julliard
parent d2dbd9bdac
commit d4ebc5298f
1 changed files with 1 additions and 21 deletions

View File

@ -1853,28 +1853,8 @@ BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHo
*/
DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
{
DWORD ret;
PMIB_TCPTABLE table;
TRACE("pTcpTable %p, pdwSize %p, bOrder %d\n", pTcpTable, pdwSize, bOrder);
if (!pdwSize) return ERROR_INVALID_PARAMETER;
ret = AllocateAndGetTcpTableFromStack(&table, bOrder, GetProcessHeap(), 0);
if (!ret) {
DWORD size = FIELD_OFFSET( MIB_TCPTABLE, table[table->dwNumEntries] );
if (!pTcpTable || *pdwSize < size) {
*pdwSize = size;
ret = ERROR_INSUFFICIENT_BUFFER;
}
else {
*pdwSize = size;
memcpy(pTcpTable, table, size);
}
HeapFree(GetProcessHeap(), 0, table);
}
TRACE("returning %d\n", ret);
return ret;
return GetExtendedTcpTable(pTcpTable, pdwSize, bOrder, AF_INET, TCP_TABLE_BASIC_ALL, 0);
}
/******************************************************************