public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: wincap: drop wow64 flag and all conditions depending on it
@ 2022-05-13 12:38 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-05-13 12:38 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2610b681a4c9f3ed568ddf0aeee8d3f48595b9ea

commit 2610b681a4c9f3ed568ddf0aeee8d3f48595b9ea
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Mar 7 10:31:15 2022 +0100

    Cygwin: wincap: drop wow64 flag and all conditions depending on it
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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_process.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 = regions; r; r = r->next)
-      if ((base >= 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 == base + 2 * wincap.page_size ()))
+      if (base >= r->start && base < r->end)
 	{
 	  char *p = 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)]
-		 == L'\\')
-	    goto file_not_symlink;
-	}
-#endif /* __i386__ */
       if ((pc_flags & (PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP)) == PC_SYM_FOLLOW)
 	{
 	  PWCHAR fpbuf = 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 = 0x40291372; /* Choose a nice start value */
   WCHAR wguid[38];
 
-  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)
 
       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 ());
 
-      /* 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);
 
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 ()
 
   ((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION);
 #ifdef __x86_64__
-  wow64 = 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 = 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;
 
 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; }
 
 #define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap; }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 12:38 [newlib-cygwin] Cygwin: wincap: drop wow64 flag and all conditions depending on it Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).