diff --git a/USBHelperLauncher/DebugMessage.cs b/USBHelperLauncher/DebugMessage.cs index 8ca2eb5..64a3ba3 100644 --- a/USBHelperLauncher/DebugMessage.cs +++ b/USBHelperLauncher/DebugMessage.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.Linq; using System.Management; @@ -15,6 +16,7 @@ using System.Threading.Tasks; using USBHelperLauncher.Configuration; using USBHelperLauncher.Utils; +using static USBHelperLauncher.Utils.WinUtil; namespace USBHelperLauncher { @@ -37,6 +39,7 @@ public async Task Build() var hosts = Program.Hosts; var locale = Program.Locale; var av = new Dictionary(); + IsWow64Process2(Process.GetCurrentProcess().Handle, out ImageFileMachine processMachine, out ImageFileMachine nativeMachine); sb.Append('-', 13).Append(" USBHelperLauncher Debug Information ").Append('-', 13).AppendLine(); sb.AppendLine("Debug Time: " + now + " (UTC)"); sb.AppendLine("Session Length: " + (now - Program.SessionStart).ToString(@"hh\:mm\:ss")); @@ -47,7 +50,8 @@ public async Task Build() sb.AppendLine("Helper Version: " + Program.HelperVersion); sb.AppendLine(".NET Framework Version: " + Get45or451FromRegistry()); sb.AppendFormat("Operating System: {0} ({1}-bit)", info.OSFullName, Environment.Is64BitOperatingSystem ? 64 : 32).AppendLine(); - sb.AppendLine("Platform: " + info.OSPlatform); + sb.AppendFormat("Native Architecture: {0}", Enum.GetName(typeof(ImageFileMachine), nativeMachine)).AppendLine(); + sb.AppendFormat("Process Architecture: {0}", Enum.GetName(typeof(ImageFileMachine), processMachine)).AppendLine(); sb.AppendLine("Used Locale: " + locale.ChosenLocale); sb.AppendLine("System Language: " + CultureInfo.CurrentUICulture.Name); sb.AppendLine("Total Memory: " + info.TotalPhysicalMemory); diff --git a/USBHelperLauncher/Utils/WinUtil.cs b/USBHelperLauncher/Utils/WinUtil.cs index 7287b37..9ff0247 100644 --- a/USBHelperLauncher/Utils/WinUtil.cs +++ b/USBHelperLauncher/Utils/WinUtil.cs @@ -108,5 +108,49 @@ public static void Delete(string keyContainer) throw new Win32Exception(Marshal.GetLastWin32Error()); } } + + // source: winnt.h + public enum ImageFileMachine + { + Unknown = 0, + I860 = 0x014D, + I386 = 0x014C, + R3000 = 0x0162, + R4000 = 0x0166, + R10000 = 0x0168, + WCEMIPSV2 = 0x0169, + ALPHA = 0x0184, + SH3 = 0x01A2, + SH3DSP = 0x01A3, + SH3E = 0x01A4, + SH4 = 0x01A6, + SH5 = 0x01A8, + ARM = 0x01C0, + THUMB = 0x01C2, + ARMNT = 0x01C4, + AM33 = 0x01D3, + POWERPC = 0x01F0, + POWERPCFP = 0x01F1, + IA64 = 0x0200, + MIPS16 = 0x0266, + ALPHA64 = 0x0284, + MIPSFPU = 0x0366, + MIPSFPU16 = 0x0466, + AXP64 = 0x0284, + TRICORE = 0x0520, + INFINEON = 0x0520, + CEF = 0x0CEF, + EBC = 0x0EBC, + AMD64 = 0x8664, + M32R = 0x9041, + AA64 = 0xAA64 + } + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool IsWow64Process2( + IntPtr process, + out ImageFileMachine processMachine, + out ImageFileMachine nativeMachine + ); } }