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".
-- v10: 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 | 14 ++++++++++++++ 3 files changed, 27 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..82497a2624e 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -3698,6 +3698,18 @@ err: return err; }
+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; +} + /****************************************************************** * GetUniDirectionalAdapterInfo (IPHLPAPI.@) * diff --git a/include/netioapi.h b/include/netioapi.h index 8c1491f9efa..adfd9c71b7e 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -166,12 +166,26 @@ 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;
On Tue Jan 30 19:05:59 2024 +0000, Rastislav Stanik wrote:
changed this line in [version 10 of the diff](/wine/wine/-/merge_requests/4940/diffs?diff_id=96822&start_sha=508ff8981c786f231cd8938b5de39ea47ef38053#f5177724934620bf34a61d786cf373a3caac591d_3605_3600)
Thanks for feedback. The changes are in.
Additionally, let's move this below the unicast table definition below.
Further, please add the function prototype (with the others, near the end).
I don't see that these comments have been addressed.