diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-05-03 08:34:44 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-05-03 08:34:44 +0000 |
commit | 00a76ece10b91c8f6664de0ddd36af596ccac3c8 (patch) | |
tree | 2618a2e2852311ae52496af6d9a614338773c6fa /winsup/cygwin/net.cc | |
parent | e32a14ca19b05a542b3971987a41104664bc197b (diff) | |
download | cygnal-00a76ece10b91c8f6664de0ddd36af596ccac3c8.tar.gz cygnal-00a76ece10b91c8f6664de0ddd36af596ccac3c8.tar.bz2 cygnal-00a76ece10b91c8f6664de0ddd36af596ccac3c8.zip |
* net.cc (get_adapters_addresses): Only create thread on affected
systems. Change comment acordingly.
* wincap.h (wincaps::has_gaa_largeaddress_bug): New element.
* wincap.cc: Implement above element throughout.
(wincap_8): New globale wincaps to support Windows 8.
(wincapc::init): Take Windows 8 into account. Set new
has_gaa_largeaddress_bug member to false on 32 bit systems.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 830a80051..a0a83b55a 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1695,13 +1695,17 @@ get_adapters_addresses (PIP_ADAPTER_ADDRESSES *pa_ret, ULONG family) DWORD ret; gaa_wa param = { family, pa_ret ?: NULL }; - if ((uintptr_t) ¶m >= (uintptr_t) 0x80000000L) + if ((uintptr_t) ¶m >= (uintptr_t) 0x80000000L + && wincap.has_gaa_largeaddress_bug ()) { - /* Starting with Windows Vista, GetAdaptersAddresses fails with error 998, + /* In Windows Vista and Windows 7 under WOW64, GetAdaptersAddresses fails if it's running in a thread with a stack located in the large address area. So, if we're running in a pthread with such a stack, we call - GetAdaptersAddresses in a child thread with an OS-allocated stack, - which is guaranteed to be located in the lower address area. */ + GetAdaptersAddresses in a child thread with an OS-allocated stack. + The OS allocates stacks bottom up, so chances are good that the new + stack will be located in the lower address area. + FIXME: The problem is fixed in W8CP, but needs testing before W8 goes + gold. */ HANDLE thr = CreateThread (NULL, 0, call_gaa, ¶m, 0, NULL); if (!thr) { |