From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id D79D9395B06F; Fri, 13 May 2022 12:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D79D9395B06F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: wincap: drop has_gaa_largeaddress_bug flag and related code X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: bf6940a4133d920a75bed91b231cf2527173287c X-Git-Newrev: 974163bc187ed7dfd0e6054491d967a5acb047db Message-Id: <20220513123907.D79D9395B06F@sourceware.org> Date: Fri, 13 May 2022 12:39:07 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 12:39:08 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D974163bc187= ed7dfd0e6054491d967a5acb047db commit 974163bc187ed7dfd0e6054491d967a5acb047db Author: Corinna Vinschen Date: Mon Mar 7 12:51:40 2022 +0100 Cygwin: wincap: drop has_gaa_largeaddress_bug flag and related code =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/net.cc | 55 ++++++++-------------------------------------= ---- winsup/cygwin/wincap.cc | 15 -------------- winsup/cygwin/wincap.h | 2 -- 3 files changed, 9 insertions(+), 63 deletions(-) diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 2209f4bde..36e2923b4 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1440,26 +1440,20 @@ cygwin_send (int fd, const void *buf, size_t len, i= nt flags) =20 /* Fill out an ifconf struct. */ =20 -struct gaa_wa { - ULONG family; - PIP_ADAPTER_ADDRESSES *pa_ret; -}; - -DWORD WINAPI -call_gaa (LPVOID param) +bool +get_adapters_addresses (PIP_ADAPTER_ADDRESSES *pa_ret, ULONG family) { DWORD ret, size =3D 0; - gaa_wa *p =3D (gaa_wa *) param; PIP_ADAPTER_ADDRESSES pa0 =3D NULL; =20 - if (!p->pa_ret) - return GetAdaptersAddresses (p->family, GAA_FLAG_INCLUDE_PREFIX - | GAA_FLAG_INCLUDE_ALL_INTERFACES, + if (!pa_ret) + return GetAdaptersAddresses (family, GAA_FLAG_INCLUDE_PREFIX + | GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, NULL, &size); do { - ret =3D GetAdaptersAddresses (p->family, GAA_FLAG_INCLUDE_PREFIX - | GAA_FLAG_INCLUDE_ALL_INTERFACES, + ret =3D GetAdaptersAddresses (family, GAA_FLAG_INCLUDE_PREFIX + | GAA_FLAG_INCLUDE_ALL_INTERFACES, NULL, pa0, &size); if (ret =3D=3D ERROR_BUFFER_OVERFLOW && !(pa0 =3D (PIP_ADAPTER_ADDRESSES) realloc (pa0, size))) @@ -1471,42 +1465,11 @@ call_gaa (LPVOID param) if (ret !=3D ERROR_SUCCESS) { free (pa0); - *p->pa_ret =3D NULL; + *pa_ret =3D NULL; } else - *p->pa_ret =3D pa0; + *pa_ret =3D pa0; } - return ret; -} - -bool -get_adapters_addresses (PIP_ADAPTER_ADDRESSES *pa_ret, ULONG family) -{ - DWORD ret; - gaa_wa param =3D { family, pa_ret }; - - if (wincap.has_gaa_largeaddress_bug () - && (uintptr_t) ¶m >=3D (uintptr_t) 0x80000000L) - { - /* In Windows 7 under WOW64, GetAdaptersAddresses fails if it's runn= ing - in a thread with a stack located in the large address area. If we're - running in a pthread with such a stack, we call 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. */ - HANDLE thr =3D CreateThread (NULL, 0, call_gaa, ¶m, 0, NULL); - SetThreadName (GetThreadId (thr), "__call_gaa"); - if (!thr) - { - debug_printf ("CreateThread: %E"); - return false; - } - WaitForSingleObject (thr, INFINITE); - GetExitCodeThread (thr, &ret); - CloseHandle (thr); - } - else - ret =3D call_gaa (¶m); return ret =3D=3D ERROR_SUCCESS || (!pa_ret && ret =3D=3D ERROR_BUFFER_O= VERFLOW); } =20 diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index e67778c2c..835497cfe 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -24,7 +24,6 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { { is_server:false, needs_query_information:true, - has_gaa_largeaddress_bug:true, has_precise_system_time:false, has_microsoft_accounts:false, has_new_pebteb_region:false, @@ -54,7 +53,6 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_com= mon"), shared)) =3D { { is_server:false, needs_query_information:true, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, @@ -84,7 +82,6 @@ wincaps wincap_8_1 __attribute__((section (".cygwin_dll_c= ommon"), shared)) =3D { { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, @@ -114,7 +111,6 @@ wincaps wincap_10_1507 __attribute__((section (".cygwi= n_dll_common"), shared)) { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, @@ -144,7 +140,6 @@ wincaps wincap_10_1607 __attribute__((section (".cygwi= n_dll_common"), shared)) { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:false, @@ -174,7 +169,6 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -204,7 +198,6 @@ wincaps wincap_10_1709 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -234,7 +227,6 @@ wincaps wincap_10_1803 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -264,7 +256,6 @@ wincaps wincap_10_1809 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -294,7 +285,6 @@ wincaps wincap_10_1903 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -324,7 +314,6 @@ wincaps wincap_10_2004 __attribute__((section (".cygwin= _dll_common"), shared)) =3D { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -354,7 +343,6 @@ wincaps wincap_11 __attribute__((section (".cygwin_dll_= common"), shared)) =3D { { is_server:false, needs_query_information:false, - has_gaa_largeaddress_bug:false, has_precise_system_time:true, has_microsoft_accounts:true, has_new_pebteb_region:true, @@ -436,9 +424,6 @@ wincapc::init () } =20 ((wincaps *)caps)->is_server =3D (version.wProductType !=3D VER_NT_WORKS= TATION); - { - ((wincaps *)caps)->has_gaa_largeaddress_bug =3D false; - } =20 __small_sprintf (osnam, "NT-%d.%d", version.dwMajorVersion, version.dwMinorVersion); diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 6b5723aa5..8184e7151 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -18,7 +18,6 @@ struct wincaps struct __attribute__ ((aligned (8))) { unsigned is_server : 1; unsigned needs_query_information : 1; - unsigned has_gaa_largeaddress_bug : 1; unsigned has_precise_system_time : 1; unsigned has_microsoft_accounts : 1; unsigned has_new_pebteb_region : 1; @@ -78,7 +77,6 @@ public: #endif bool IMPLEMENT (is_server) bool IMPLEMENT (needs_query_information) - bool IMPLEMENT (has_gaa_largeaddress_bug) bool IMPLEMENT (has_precise_system_time) bool IMPLEMENT (has_microsoft_accounts) bool IMPLEMENT (has_new_pebteb_region)