static private int GetProcessBitness(IntPtr hProcess) { if (System.Environment.Is64BitOperatingSystem) { bool wow64; if (!ProcessNativeMethods.IsWow64Process(hProcess, out wow64)) { return(32); } if (wow64) { return(32); } return(64); } else { return(32); } }