是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行? [英] Is there a Windows API call that will tell me if I'm running on a 64-bit OS?
问题描述
是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行?我有一些遗留的 C++ 代码,它调用 GetVersionEx 来填充 OSVERSIONINFO 结构,但这仅告诉我(AFAIK)操作系统(Vista、V7 等),而不是处理架构.我可以通过简单地寻找C:\Program Files (x86)..."的存在来解决这个问题,但这看起来很难看.我确定必须有一个 API 来返回此信息.
IsWow64Process
可能就是您要找的.p>
Is there a Windows API call that will tell me if I'm running on a 64-bit OS? I have some legacy c++ code that makes a call to GetVersionEx to fill in a OSVERSIONINFO structure, but that only tells me (AFAIK) the OS (Vista, V7, etc.), but not the processing architecture. I can hack around this by simply looking for the existence of "C:\Program Files (x86)...", but this seems ugly. I'm sure there must be an API to return this info.
IsWow64Process
might be what you are looking for.
这篇关于是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!