gdk/win32: Consolidate CPU detection in one place

This consolidates the check for the running CPU in one single location,
to make things a bit cleaner, as:

* We can make use of IsWow64Process2(), if available, to check both
  whether we are running on an ARM64 CPU, and whether we are running as
  a WOW64 process.  This is also the function to use to properly check
  whether we are running as a WOW64 process on ARM64 systems, as
  IsWow64Process() does not work as we want on ARM64 systems.

* If we don't have IsWow64Process2() (which is absent from Windows prior
  to Windows 10 1511, where ARM64 Windows is introduced), we can fall
  back to  IsWow64Process(), which will tell us whether we are running
  as an WOW64 process (but clearly not on an ARM64 system).

Also clean up things a bit so that we can reduce reliance on global
variables.
This commit is contained in:
Chun-wei Fan
2020-10-16 18:22:01 +08:00
committed by Philip Zander
parent aa3e6bb0a3
commit 4a55c527d7
4 changed files with 48 additions and 33 deletions

View File

@ -124,7 +124,6 @@ struct _GdkWin32Display
GdkWin32User32DPIFuncs user32_dpi_funcs;
/* Running CPU items */
GdkWin32KernelCPUFuncs cpu_funcs;
};
struct _GdkWin32DisplayClass