diff --git a/mRemoteV1/App/Info/GeneralAppInfo.cs b/mRemoteV1/App/Info/GeneralAppInfo.cs index fc0e092a7..304fcd652 100644 --- a/mRemoteV1/App/Info/GeneralAppInfo.cs +++ b/mRemoteV1/App/Info/GeneralAppInfo.cs @@ -28,7 +28,7 @@ namespace mRemoteNG.App.Info var details = new List(); details.Add("compatible"); details.Add(OSVersion.Platform == PlatformID.Win32NT ? $"Windows NT {OSVersion.Version.Major}.{OSVersion.Version.Minor}": OSVersion.VersionString); - if (Tools.EnvironmentInfo.IsWow64) + if (Is64BitProcess) { details.Add("WOW64"); } diff --git a/mRemoteV1/Tools/EnvironmentInfo.cs b/mRemoteV1/Tools/EnvironmentInfo.cs deleted file mode 100644 index 7fe09a389..000000000 --- a/mRemoteV1/Tools/EnvironmentInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - - -namespace mRemoteNG.Tools -{ - public class EnvironmentInfo - { - public static bool IsWow64 - { - get - { - Win32.IsWow64ProcessDelegate isWow64ProcessDelegate = GetIsWow64ProcessDelegate(); - if (isWow64ProcessDelegate == null) - { - return false; - } - - bool isWow64Process = false; - bool result = Convert.ToBoolean(isWow64ProcessDelegate.Invoke(Process.GetCurrentProcess().Handle, ref isWow64Process)); - if (!result) - { - return false; - } - - return isWow64Process; - } - } - - private static Win32.IsWow64ProcessDelegate GetIsWow64ProcessDelegate() - { - IntPtr moduleHandle = Win32.LoadLibrary("kernel32"); - if (moduleHandle == IntPtr.Zero) - { - return null; - } - - IntPtr functionPointer = Win32.GetProcAddress(moduleHandle, "IsWow64Process"); - if (functionPointer == IntPtr.Zero) - { - return null; - } - - return (Win32.IsWow64ProcessDelegate)Marshal.GetDelegateForFunctionPointer(functionPointer, typeof(Win32.IsWow64ProcessDelegate)); - } - - protected class Win32 - { - // ReSharper disable InconsistentNaming - [DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr LoadLibrary([In(), MarshalAs(UnmanagedType.LPTStr)]string lpFileName); - - [DllImport("kernel32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)] - public static extern IntPtr GetProcAddress([In()]IntPtr hModule, [In(), MarshalAs(UnmanagedType.LPStr)]string lpProcName); - - public delegate bool IsWow64ProcessDelegate([In()]IntPtr hProcess, ref bool Wow64Process); - // ReSharper restore InconsistentNaming - } - } -} diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 0eb726c50..dbc9c9e33 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -300,7 +300,6 @@ -