Large memory reporting

Dmitry Timoshkov dmitry at
Sun Aug 15 05:17:02 CDT 2004

"Shachar Shemesh" <wine-devel at> wrote:

> If so, is there a way for me, when at the heap.c code, to know whether 
> that flag was set on loading the current process?

(copied from dlls/ntdll/loader.c):

PEB *peb = NtCurrentTeb()->Peb;
IMAGE_NT_HEADERS *nt = RtlImageNtHeader( peb->ImageBaseAddress );

if (nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE)
    return full_address_range_of_the_application;
    return 2Gb_of_adderess_space;

or even better reimplement GlobalMemoryStatus via VirtualQuery and
leave all system dependent code to ntdll.NtQueryVirtualMemory.


More information about the wine-devel mailing list