如何确定进程是32位还是64位? [英] How can I determine whether a process is 32 or 64 bit?
本文介绍了如何确定进程是32位还是64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Windows进程句柄,如何使用C ++代码确定该进程是32位还是64位?
Given a Windows process handle, how can I determine, using C++ code, whether the process is 32 bit or 64 bit?
推荐答案
如果您有模块的句柄,则可以执行以下操作:
If you have handle to the module then you can do this:
IMAGE_NT_HEADERS * headers = ImageNtHeader(handle);
if ( headers->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 )
{
//module is x86
}
else if ( headers->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 )
{
//module is x64
}
我从我自己的答案中寻求帮助。
这篇关于如何确定进程是32位还是64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文