[IPHLPAPI] Implement AllocateAndGetUdpExTable2FromStack()

CORE-14391
This commit is contained in:
Pierre Schweitzer 2018-11-25 13:32:52 +01:00
parent 0bca12e01f
commit 26415375e3
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
2 changed files with 47 additions and 1 deletions

View file

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

View file

@ -484,6 +484,52 @@ DWORD WINAPI AllocateAndGetUdpExTableFromStack(PMIB_UDPTABLE_OWNER_PID *ppUdpTab
} }
/******************************************************************
* AllocateAndGetUdpExTable2FromStack (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
* class [In] -- passed to GetExtendedUdpTable to select information
*
* RETURNS
*
* DWORD
*
*/
DWORD WINAPI AllocateAndGetUdpExTable2FromStack(PVOID *ppUdpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family, UDP_TABLE_CLASS class)
{
DWORD ret;
TRACE("ppUdpTable %p, bOrder %ld, heap 0x%08lx, flags 0x%08lx, family %ld, class %ld\n",
ppUdpTable, (DWORD)bOrder, (DWORD)heap, flags, family, class);
if (!ppUdpTable)
ret = ERROR_INVALID_PARAMETER;
else {
DWORD dwSize = 0;
*ppUdpTable = NULL;
ret = GetExtendedUdpTable(*ppUdpTable, &dwSize, bOrder, family, class, 0);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppUdpTable = HeapAlloc(heap, flags, dwSize);
ret = GetExtendedUdpTable(*ppUdpTable, &dwSize, bOrder, family, class, 0);
if (ret != NO_ERROR) {
HeapFree(heap, flags, *ppUdpTable);
*ppUdpTable = NULL;
}
}
}
TRACE("returning %ld\n", ret);
return ret;
}
/****************************************************************** /******************************************************************
* CreateIpForwardEntry (IPHLPAPI.@) * CreateIpForwardEntry (IPHLPAPI.@)
* *