mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-09-19 18:01:25 +03:00
Fix -Wincompatible-pointer-types in Win32GetDnsSuffix
Explicitly cast the `IP_ADAPTER_ADDRESSES_XP *` pointer to `PIP_ADAPTER_ADDRESSES` when calling `GetAdaptersAddresses` in `src/Mayaqua/Network.c`. This resolves build errors with modern Windows SDKs (e.g., 10.0.26100.0) where `PIP_ADAPTER_ADDRESSES` resolves to `IP_ADAPTER_ADDRESSES_LH *`, which compilers like Clang flag as an incompatible pointer type.
This commit is contained in:
@@ -9265,12 +9265,12 @@ bool Win32GetDnsSuffix(char *domain, UINT size)
|
||||
|
||||
info_size = 0;
|
||||
info = ZeroMalloc(sizeof(IP_ADAPTER_ADDRESSES_XP));
|
||||
if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) == ERROR_BUFFER_OVERFLOW)
|
||||
if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) == ERROR_BUFFER_OVERFLOW)
|
||||
{
|
||||
Free(info);
|
||||
info = ZeroMalloc(info_size);
|
||||
}
|
||||
if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) != NO_ERROR)
|
||||
if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) != NO_ERROR)
|
||||
{
|
||||
Free(info);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user