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 | 15 +++++++++++++++ 3 files changed, 28 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..82b4731b848 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -172,6 +172,20 @@ typedef struct _MIB_UNICASTIPADDRESS_TABLE MIB_UNICASTIPADDRESS_ROW Table[1]; } MIB_UNICASTIPADDRESS_TABLE, *PMIB_UNICASTIPADDRESS_TABLE;
+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_ANYCASTIPADDRESS_TABLE +{ + ULONG NumEntries; + MIB_ANYCASTIPADDRESS_ROW Table[ANY_SIZE]; +} MIB_ANYCASTIPADDRESS_TABLE, *PMIB_ANYCASTIPADDRESS_TABLE; + typedef struct _IP_ADDRESS_PREFIX { SOCKADDR_INET Prefix; @@ -266,6 +280,7 @@ IPHLPAPI_DLL_LINKAGE DWORD WINAPI GetIpNetEntry2(MIB_IPNET_ROW2*); IPHLPAPI_DLL_LINKAGE DWORD WINAPI GetIpNetTable2(ADDRESS_FAMILY,MIB_IPNET_TABLE2**); IPHLPAPI_DLL_LINKAGE DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW*); IPHLPAPI_DLL_LINKAGE DWORD WINAPI GetUnicastIpAddressTable(ADDRESS_FAMILY,MIB_UNICASTIPADDRESS_TABLE**); +IPHLPAPI_DLL_LINKAGE DWORD WINAPI GetAnycastIpAddressTable(ADDRESS_FAMILY,MIB_ANYCASTIPADDRESS_TABLE**); IPHLPAPI_DLL_LINKAGE PCHAR WINAPI if_indextoname(NET_IFINDEX,PCHAR); IPHLPAPI_DLL_LINKAGE NET_IFINDEX WINAPI if_nametoindex(PCSTR);