确定正在运行的可执行文件是否具有IMAGE_FILE_LARGE_ADDRESS_AWARE? [英] Determining if the running executable has IMAGE_FILE_LARGE_ADDRESS_AWARE?

查看:94
本文介绍了确定正在运行的可执行文件是否具有IMAGE_FILE_LARGE_ADDRESS_AWARE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在某种Windows API或其他相当直接的方法来确定当前正在运行的程序是否已启用IMAGE_FILE_LARGE_ADDRESS_AWARE?我知道我可以将进程的exe作为文件打开,读取其标头信息,然后将其解析到某个地方,但是,如果有更清洁的方法,我想知道.

Is there some sort of Windows API or other reasonably straightforward way to determine whether or not the currently running program has IMAGE_FILE_LARGE_ADDRESS_AWARE enabled? I know that I can open up the process's exe as a file, read its header information, and parse it somewhere out of there, but if there's some cleaner way to do it, I'd like to know.

要明确:我正在谈论当前正在执行的过程-即,我想编写代码来检测其自身可执行文件(而不是某些完全不同的可执行文件)的标志(或缺少标志).

To be clear: I am talking about the currently executing process - i.e. I want to write code that detects this flag (or lack thereof) for its own executable, not for some entirely different executable.

推荐答案

使用

Use the GlobalMemoryStatusEx function to query the amount of virtual memory available to your process.

如果 ullTotalVirtual 在32位进程中返回的内存超过2GB,则说明 LARGE_ADDRESS_AWARE 标志已设置.

If ullTotalVirtual returns more than 2GB in a 32-bit process you know the LARGE_ADDRESS_AWARE flag is set.

这篇关于确定正在运行的可执行文件是否具有IMAGE_FILE_LARGE_ADDRESS_AWARE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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