The PID is a Process ID. It's just a number and doesn't tell you anything at all about the process.
You have to get a Process object using
Process.GetProcessById Method (Int32) (System.Diagnostics)[
^]. When you've got the Process object you call the below code to determine if it's 64-bit or not.
You'll need a bit of code to make the call to Windows...
internal static class NativeMethods
{
public static bool Is64Bit(Process process)
{
if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "x86")
return false;
bool isWow64;
if (!IsWow64Process(process.Handle, out isWow64))
throw new Win32Exception();
return !isWow64;
}
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
}
And you call it like this:
int pid = browser.Chrome();
Process process = Process.GetProcessById(pid);
bool is64Bit = NativeMethods.Is64Bit(process);