aboutsummaryrefslogtreecommitdiffstats
path: root/main/wine/iphlpapi-fix.patch
blob: 6b8fe5548a1411cee3a73affe271750a21489767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index d734c39..321c0a3 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1115,6 +1115,10 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
         {
             if (aa->IfType != IF_TYPE_SOFTWARE_LOOPBACK && aa->OperStatus == IfOperStatusUp)
                 aa->DnsSuffix = dnsSuffix;
+            else
+                /* MSVC runtime requires DnsSuffix to be valid pointer
+                 * make it an empty string */
+                aa->DnsSuffix = (WCHAR *)((BYTE*)dnsSuffix + dns_suffix_size - 2);
         }
         ret = ERROR_SUCCESS;
     }