summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-28 07:26:01 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-28 08:04:00 +0000
commit4f6d3b0eedc95bc3c83b1cbc96027f9380abd0c0 (patch)
tree7131a0dd7abfd44994a7b7687c757e96cc0c4b7f
parentee63abc3d0ddcc2aef2abd4d5196681751fb46c3 (diff)
downloadaports-4f6d3b0eedc95bc3c83b1cbc96027f9380abd0c0.tar.bz2
aports-4f6d3b0eedc95bc3c83b1cbc96027f9380abd0c0.tar.xz
main/wine: use patch from upstream
-rw-r--r--main/wine/APKBUILD4
-rw-r--r--main/wine/iphlpapi-fix.patch98
2 files changed, 96 insertions, 6 deletions
diff --git a/main/wine/APKBUILD b/main/wine/APKBUILD
index 4bda3f286..b518e8946 100644
--- a/main/wine/APKBUILD
+++ b/main/wine/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=wine
pkgver=1.3.10
-pkgrel=0
+pkgrel=1
pkgdesc="A compatibility layer for running Windows programs"
url="http://www.winehq.com"
arch="x86"
@@ -41,4 +41,4 @@ package() {
}
md5sums="a9f616cdcfb07a832c25623d3a971c3c wine-1.3.10.tar.bz2
6ebeaa64eddf97be3267db236ce84b71 dn_skipname.patch
-d3d0e26eb5b9937e5e1139597b6c3f5b iphlpapi-fix.patch"
+9ce93380a05e9b2eb8763df8f2493b9f iphlpapi-fix.patch"
diff --git a/main/wine/iphlpapi-fix.patch b/main/wine/iphlpapi-fix.patch
index 6b8fe5548..57385b987 100644
--- a/main/wine/iphlpapi-fix.patch
+++ b/main/wine/iphlpapi-fix.patch
@@ -1,15 +1,105 @@
+From: Timo Teräs <timo.teras@iki.fi>
+Subject: iphlpapi: fix GetAdaptersAddresses return values
+Message-Id: <1293436581-14632-1-git-send-email-timo.teras@iki.fi>
+Date: Mon, 27 Dec 2010 09:56:21 +0200
+
+
+We should return ERROR_BUFFER_OVERFLOW always if the buffer
+pointer is NULL (regardless of old buffer length).
+
+Additionally, while strictly not defined, Windows seems to always
+return the WCHAR members as valid pointers. This is easily verified
+by checking the output of the example code at:
+http://msdn.microsoft.com/en-us/library/aa365915%28v=VS.85%29.aspx
+In Windows it will not print (null) ever. Some programs seem to
+rely on this behaviour.
+
+One test case which does not work at all without these changes is
+available from:
+http://www.ipv6style.jp/files/ipv6/en/apps/20060320_2/GetAdaptersAddresses-EN.c
+
+This updates also the test cases to verify both changes, and
+additionally fixes a memory leak in the tests code.
+---
+I also have a similar patch for wine stable branch (1.2.x tree).
+The iphlpapi has been changed a lot recently, so the fix is
+slightly different there.
+
+ dlls/iphlpapi/iphlpapi_main.c | 5 ++++-
+ dlls/iphlpapi/tests/iphlpapi.c | 21 ++++++++++++++-------
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
-index d734c39..321c0a3 100644
+index d734c39..3995a17 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,
+@@ -1115,10 +1115,13 @@ 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;
}
+- if (*buflen < total_size) ret = ERROR_BUFFER_OVERFLOW;
++ else
++ ret = ERROR_BUFFER_OVERFLOW;
+ *buflen = total_size;
+
+ TRACE("num adapters %u\n", table->numIndexes);
+diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
+index 823e596..a747423 100644
+--- a/dlls/iphlpapi/tests/iphlpapi.c
++++ b/dlls/iphlpapi/tests/iphlpapi.c
+@@ -819,7 +819,7 @@ static void testWin2KFunctions(void)
+ static void test_GetAdaptersAddresses(void)
+ {
+ ULONG ret, size;
+- IP_ADAPTER_ADDRESSES *aa;
++ IP_ADAPTER_ADDRESSES *aa, *ptr;
+ IP_ADAPTER_UNICAST_ADDRESS *ua;
+
+ if (!gGetAdaptersAddresses)
+@@ -831,17 +831,25 @@ static void test_GetAdaptersAddresses(void)
+ ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL);
+ ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret);
+
+- size = 0;
++ /* size should be ignored and overwritten if buffer is NULL */
++ size = 0x7fffffff;
+ ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size);
+ ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret);
+ if (ret != ERROR_BUFFER_OVERFLOW) return;
+
+- aa = HeapAlloc(GetProcessHeap(), 0, size);
+- ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, aa, &size);
++ ptr = HeapAlloc(GetProcessHeap(), 0, size);
++ ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &size);
+ ok(!ret, "expected ERROR_SUCCESS got %u\n", ret);
+
+- while (!ret && winetest_debug > 1 && aa)
++ for (aa = ptr; !ret && aa; aa = aa->Next)
+ {
++ ok(aa->DnsSuffix != NULL, "DnsSuffix is not a valid pointer\n");
++ ok(aa->Description != NULL, "Description is not a valid pointer\n");
++ ok(aa->FriendlyName != NULL, "FriendlyName is not a valid pointer\n");
++
++ if (winetest_debug <= 1)
++ continue;
++
+ trace("Length: %u\n", S(U(*aa)).Length);
+ trace("IfIndex: %u\n", S(U(*aa)).IfIndex);
+ trace("Next: %p\n", aa->Next);
+@@ -877,9 +885,8 @@ static void test_GetAdaptersAddresses(void)
+ trace("IfType: %u\n", aa->IfType);
+ trace("OperStatus: %u\n", aa->OperStatus);
+ trace("\n");
+- aa = aa->Next;
+ }
+- HeapFree(GetProcessHeap(), 0, aa);
++ HeapFree(GetProcessHeap(), 0, ptr);
+ }
+
+ START_TEST(iphlpapi)
+