[IPHLPAPI] Implement AllocateAndGetUdpExTableFromStack()

This commit is contained in:
Pierre Schweitzer 2018-11-25 12:23:27 +01:00
parent 58799a0ceb
commit 291a58951f
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
2 changed files with 46 additions and 1 deletions

View file

@ -8,7 +8,7 @@
@ stdcall AllocateAndGetTcpExTableFromStack( ptr long long long long )
@ stdcall AllocateAndGetTcpTableFromStack( ptr long long long )
@ stub AllocateAndGetUdpExTable2FromStack
@ stub AllocateAndGetUdpExTableFromStack
@ stdcall AllocateAndGetUdpExTableFromStack( ptr long long long long )
@ stdcall AllocateAndGetUdpTableFromStack( ptr long long long )
@ stdcall CancelIPChangeNotify(ptr)
@ stub CancelSecurityHealthChangeNotify

View file

@ -393,6 +393,51 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable,
}
/******************************************************************
* AllocateAndGetUdpExTableFromStack (IPHLPAPI.@)
*
*
* PARAMS
*
* ppUdpTable [Out]
* bOrder [In] -- passed to GetExtendedUdpTable to order the table
* heap [In] -- heap from which the table is allocated
* flags [In] -- flags to HeapAlloc
* family [In] -- passed to GetExtendedUdpTable to select INET family
*
* RETURNS
*
* DWORD
*
*/
DWORD WINAPI AllocateAndGetUdpExTableFromStack(PMIB_UDPTABLE_OWNER_PID *ppUdpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family)
{
DWORD ret;
TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family 0x%08lx\n",
ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags, family);
if (!ppUdpTable)
ret = ERROR_INVALID_PARAMETER;
else {
DWORD dwSize = 0;
*ppUdpTable = NULL;
ret = GetExtendedUdpTable(*ppUdpTable, &dwSize, bOrder, family, UDP_TABLE_OWNER_PID, 0);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppUdpTable = (PMIB_UDPTABLE_OWNER_PID)HeapAlloc(heap, flags, dwSize);
ret = GetExtendedUdpTable(*ppUdpTable, &dwSize, bOrder, family, UDP_TABLE_OWNER_PID, 0);
if (ret != NO_ERROR) {
HeapFree(heap, flags, *ppUdpTable);
*ppUdpTable = NULL;
}
}
}
TRACE("returning %ld\n", ret);
return ret;
}
/******************************************************************
* CreateIpForwardEntry (IPHLPAPI.@)
*