public static bool Is64BitProcess(IntPtr handle) { if (!Environment.Is64BitOperatingSystem) { return(false); } if (!Native.IsWow64Process(handle, out bool isWow64)) { return(IntPtr.Size == 8); // assume it's the same as the current process } return(!isWow64); }
public static bool Is64Bit(this Process p) { if (!Environment.Is64BitOperatingSystem) { return(false); } if (!Native.IsWow64Process(p.Handle, out bool isWow64)) { throw new Win32Exception(); } return(!isWow64); }