for details see https://bugs.winehq.org/show_bug.cgi?id=56065 This change adds an implementation of Win32 API function GetAnycastIpAddressTable() that is used by Adoptium OpenJDK 21 and later to initialize Secure Random Generator. This implementation does not return real information, it just says "no entries found".
-- v8: iphlpapi: add stub for GetAnycastIpAddressTable().
From: Rastislav Stanik gitlab@rastos.org
This change adds an implementation of Win32 API function GetAnycastIpAddressTable() that does not return real information, it just says "no entries found".
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56065 --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/iphlpapi_main.c | 12 ++++++++++++ include/netioapi.h | 13 +++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index ef2c576947d..dcc15a2753e 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -73,7 +73,7 @@ @ stdcall GetAdaptersAddresses( long long ptr ptr ptr ) @ stdcall GetAdaptersInfo( ptr ptr ) #@ stub GetAnycastIpAddressEntry -#@ stub GetAnycastIpAddressTable +@ stdcall GetAnycastIpAddressTable( long ptr ) @ stdcall GetBestInterface( long ptr ) @ stdcall GetBestInterfaceEx( ptr ptr ) @ stub GetBestInterfaceFromStack diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 9c7582b71fb..b1e9af9840e 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -3597,6 +3597,18 @@ static void unicast_row_fill( MIB_UNICASTIPADDRESS_ROW *row, USHORT fam, void *k row->CreationTimeStamp.QuadPart = stat->creation_time; }
+DWORD WINAPI GetAnycastIpAddressTable(ADDRESS_FAMILY family, MIB_ANYCASTIPADDRESS_TABLE **table) +{ + FIXME( "(%u, %p) stub\n", family, table ); + if (!table || (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC)) + return ERROR_INVALID_PARAMETER; + + *table = heap_alloc_zero(sizeof(MIB_ANYCASTIPADDRESS_TABLE)); + if (!*table) return ERROR_NOT_ENOUGH_MEMORY; + (*table)->NumEntries = 0; + return NO_ERROR; +} + DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row) { struct nsi_ipv4_unicast_key key4; diff --git a/include/netioapi.h b/include/netioapi.h index 8c1491f9efa..24b4f42d645 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -166,12 +166,25 @@ typedef struct _MIB_UNICASTIPADDRESS_ROW LARGE_INTEGER CreationTimeStamp; } MIB_UNICASTIPADDRESS_ROW, *PMIB_UNICASTIPADDRESS_ROW;
+typedef struct _MIB_ANYCASTIPADDRESS_ROW { + SOCKADDR_INET Address; + NET_LUID InterfaceLuid; + NET_IFINDEX InterfaceIndex; + SCOPE_ID ScopeId; +} MIB_ANYCASTIPADDRESS_ROW, *PMIB_ANYCASTIPADDRESS_ROW; + typedef struct _MIB_UNICASTIPADDRESS_TABLE { ULONG NumEntries; MIB_UNICASTIPADDRESS_ROW Table[1]; } MIB_UNICASTIPADDRESS_TABLE, *PMIB_UNICASTIPADDRESS_TABLE;
+typedef struct _MIB_ANYCASTIPADDRESS_TABLE +{ + ULONG NumEntries; + MIB_ANYCASTIPADDRESS_ROW Table[ANY_SIZE]; +} MIB_ANYCASTIPADDRESS_TABLE, *PMIB_ANYCASTIPADDRESS_TABLE; + typedef struct _IP_ADDRESS_PREFIX { SOCKADDR_INET Prefix;