是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行? [英] Is there a Windows API call that will tell me if I'm running on a 64-bit OS?

查看:30
本文介绍了是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有 Windows API 调用会告诉我我是否在 64 位操作系统上运行?我有一些遗留的 C++ 代码,它调用 GetVersionEx 来填充 OSVERSIONINFO 结构,但这仅告诉我(AFAIK)操作系统(Vista、V7 等),而不是处理架构.我可以通过简单地寻找C:\Program Files (x86)..."的存在来解决这个问题,但这看起来很难看.我确定必须有一个 API 来返回此信息.

解决方案

IsWow64Process 可能就是您要找的.

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屋!

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