如何判断另一个进程是否为 64 位? [英] How can I tell if another process is 64bit?

查看:26
本文介绍了如何判断另一个进程是否为 64 位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个流程正在运行的应用程序.

I've got a Process for a running application.

我如何判断(最好不使用 p/invoking)该进程是否为 64 位?

How can I tell (without p/invoking, preferably) if that process is 64bit?

推荐答案

我认为没有 PInvoke 就没有 100% 确定的方法.

I don't think there is a 100% definitive way to know without a PInvoke.

但有一项可能起作用的是检查加载的模块集(Process.Modules).如果主要模块(user32、kernel32 等...)来自 Wow64 目录并且您运行的是 64 位机器,那么它很有可能是 32 位进程.如果它们不是来自 Wow64 目录并且它是 64 位机器,那么它很可能是一个 64 位进程.

But one item which may work though is to inspect the set of loaded modules (Process.Modules). If the primary modules (user32, kernel32, etc ...) come from the Wow64 directory and you're running an a 64 bit machine then there is a solid chance it's a 32 bit process. If they don't come from the Wow64 directory and it's a 64 bit machine then it's likely it's a 64 bit process.

同样不是确定的,而是一个很好的估计.

Again not definitive but a good estimate.

这篇关于如何判断另一个进程是否为 64 位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆