From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id A5CEF395B072; Fri, 13 May 2022 12:38:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5CEF395B072 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 wow64 flag and all conditions depending on it X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 0597c84b9bdbdab806fb4674565f173d59475da7 X-Git-Newrev: 2610b681a4c9f3ed568ddf0aeee8d3f48595b9ea Message-Id: <20220513123837.A5CEF395B072@sourceware.org> Date: Fri, 13 May 2022 12:38:37 +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:38:37 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2610b681a4c= 9f3ed568ddf0aeee8d3f48595b9ea commit 2610b681a4c9f3ed568ddf0aeee8d3f48595b9ea Author: Corinna Vinschen Date: Mon Mar 7 10:31:15 2022 +0100 Cygwin: wincap: drop wow64 flag and all conditions depending on it =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/fhandler_process.cc | 6 +----- winsup/cygwin/path.cc | 22 ---------------------- winsup/cygwin/syscalls.cc | 3 +-- winsup/cygwin/uname.cc | 11 ++--------- winsup/cygwin/wincap.cc | 6 ------ winsup/cygwin/wincap.h | 2 -- 6 files changed, 4 insertions(+), 46 deletions(-) diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_pro= cess.cc index 718945b9a..e2dd1286f 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -784,11 +784,7 @@ struct thread_info char *fill_if_match (char *base, ULONG type, char *dest) { for (region *r =3D regions; r; r =3D r->next) - if ((base >=3D r->start && base < r->end) - /* Special case WOW64. The TEB is 8K within the region reserved - for it. No idea what the lower 8K are used for. */ - || (r->teb && wincap.is_wow64 () - && r->start =3D=3D base + 2 * wincap.page_size ())) + if (base >=3D r->start && base < r->end) { char *p =3D dest + __small_sprintf (dest, "[%s (tid %ld)", r->teb ? "teb" : "stack", diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index e370843ee..b00f4c4f8 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3461,28 +3461,6 @@ restart: differ, return the final path as symlink content and set symlen to a negative value. This forces path_conv::check to restart symlink evaluation with the new path. */ -#ifdef __i386__ - /* On WOW64, ignore any potential problems if the path is inside - the Windows dir to avoid false positives for stuff under File - System Redirector control. Believe it or not, but even - GetFinalPathNameByHandleA returns the converted path for the - Sysnative dir. I. e. - - C:\Windows\Sysnative --> C:\Windows\System32 - - This is obviously wrong when using this path for further - file manipulation because the non-final path points to another - file than the final path. Oh well... */ - if (!fs.is_remote_drive () && wincap.is_wow64 ()) - { - /* windows_directory_path is stored without trailing backslash, - so we have to check this explicitely. */ - if (RtlEqualUnicodePathPrefix (&upath, &windows_directory_path, TRUE) - && upath.Buffer[windows_directory_path.Length / sizeof (WCHAR)] - =3D=3D L'\\') - goto file_not_symlink; - } -#endif /* __i386__ */ if ((pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) =3D=3D PC_SYM= _FOLLOW) { PWCHAR fpbuf =3D tp.w_get (); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index bb9df76cf..b68d1f215 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -4417,8 +4417,7 @@ gethostid (void) int32_t hostid =3D 0x40291372; /* Choose a nice start value */ WCHAR wguid[38]; =20 - reg_key key (HKEY_LOCAL_MACHINE, - KEY_READ | (wincap.is_wow64() ? KEY_WOW64_64KEY : 0), + reg_key key (HKEY_LOCAL_MACHINE, KEY_READ, L"SOFTWARE", L"Microsoft", L"Cryptography", NULL); key.get_string (L"MachineGuid", wguid, 38, L"00000000-0000-0000-0000-000000000000"); diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc index 350216681..41138150c 100644 --- a/winsup/cygwin/uname.cc +++ b/winsup/cygwin/uname.cc @@ -36,9 +36,8 @@ uname_x (struct utsname *name) =20 memset (name, 0, sizeof (*name)); /* sysname */ - __small_sprintf (name->sysname, "CYGWIN_%s-%u%s", - wincap.osname (), wincap.build_number (), - wincap.is_wow64 () ? "-WOW64" : ""); + __small_sprintf (name->sysname, "CYGWIN_%s-%u", + wincap.osname (), wincap.build_number ()); /* nodename */ memset (buf, 0, sizeof buf); cygwin_gethostname (buf, sizeof buf - 1); @@ -100,12 +99,6 @@ uname (struct utsname *in_name) memset (name, 0, sizeof (*name)); __small_sprintf (name->sysname, "CYGWIN_%s", wincap.osname ()); =20 - /* Add a hint to the sysname, that we're running under WOW64. This = might - give an early clue if somebody encounters problems. */ - if (wincap.is_wow64 ()) - strncat (name->sysname, "-WOW", - sizeof name->sysname - strlen (name->sysname) - 1); - /* Computer name */ cygwin_gethostname (name->nodename, sizeof (name->nodename) - 1); =20 diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index ffc32140b..c153627ab 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -461,14 +461,8 @@ wincapc::init () =20 ((wincaps *)caps)->is_server =3D (version.wProductType !=3D VER_NT_WORKS= TATION); #ifdef __x86_64__ - wow64 =3D 0; /* 64 bit systems have one more guard page than their 32 bit counterpart= . */ ++((wincaps *)caps)->def_guard_pages; -#else - if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (), - ProcessWow64Information, - &wow64, sizeof wow64, NULL)) - && !wow64) #endif { ((wincaps *)caps)->has_gaa_largeaddress_bug =3D false; diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 1602ed6e1..26cf4be8b 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -49,7 +49,6 @@ class wincapc SYSTEM_INFO system_info; RTL_OSVERSIONINFOEXW version; char osnam[40]; - ULONG_PTR wow64; void *caps; =20 public: @@ -69,7 +68,6 @@ public: { return (size_t) system_info.dwAllocationGranularity; } const char *osname () const { return osnam; } const DWORD build_number () const { return version.dwBuildNumber; } - const bool is_wow64 () const { return !!wow64; } =20 #define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap;= }