/LARGEADDRESSAWARE

All development related issues welcome

Moderator: Moderator Team

Post Reply
The_GTA
Posts: 6
Joined: Wed Sep 21, 2016 5:05 pm

/LARGEADDRESSAWARE

Post by The_GTA »

Hello ReactOS developers,

here are my questions regarding Windows NT PE loading. Please answer them as I need your support while I am writing a PE loader library.

1) Does ReactOS support the IMAGE_FILE_LARGE_ADDRESS_AWARE flag?
2) What is the official Win32 API to retrieve the memory regions VirtualAlloc can allocate on?
Possibly related: GlobalMemoryStatusEx, NtQueryInformationProcess with ProcessVmCounters, win32 working set size
3) Is there API to enable /LARGEADDRESSAWARE during process runtime from user-mode? (NT api, Win32 api, etc)

I have scavenged the source code and not found a trace of said functionality. It looks as if ReactOS was not even 64bit ready. But ReactOS is interesting nonetheless, just very complicated to understand...

Martin.

EDIT: if you would like to see the PE loader I work on, it is located here.

User avatar
Michael Long
Posts: 40
Joined: Wed Oct 25, 2017 7:51 pm

Re: /LARGEADDRESSAWARE

Post by Michael Long »

regarding 1)
I have no idea about the support in ReactOS but I don't think that the size manipulation of user space and kernel space is even supported by all versions of Windows. It works in some versions of Windows XP and Windows Vista but I am not so sure about the older versions.

regarding 3)
From the research I have done I haven't found a way to do this after Windows has booted/without using the boot options. But of course I don't know everything.

In general: If you need more memory then there are other ways. Especially if you like to use something like 10 GB in Windows 32 bit or 64 bit you can't work with a 3 GB or 4 GB user space alone anyway. You might want to look into other ways like address windowing extension (AWE) or using several 4 GB segments.
Last edited by Michael Long on Mon Oct 30, 2017 9:27 pm, edited 2 times in total.

milon
Posts: 969
Joined: Sat Sep 05, 2009 9:26 pm

Re: /LARGEADDRESSAWARE

Post by milon »

Hi Michael. Thanks for your input. I don't think The_GTA is too worried about getting an answer - it was one question (and 1 post) over a year ago, and hasn't followed up or shown any other interest since. *shrug* These things happen.

But it would be awesome if you stuck around, tried ReactOS in a virtual machine (or spare hardware, but NOT your every day machine), and let us know how it goes! :)

User avatar
Michael Long
Posts: 40
Joined: Wed Oct 25, 2017 7:51 pm

Re: /LARGEADDRESSAWARE

Post by Michael Long »

:oops: Oops sorry, I thought the post was from end of September 2017. I missed to check the year somehow.

The_GTA
Posts: 6
Joined: Wed Sep 21, 2016 5:05 pm

Re: /LARGEADDRESSAWARE

Post by The_GTA »

Michael Long wrote:regarding 1)
I have no idea about the support in ReactOS but I don't think that the size manipulation of user space and kernel space is even supported by all versions of Windows. It works in some versions of Windows XP and Windows Vista but I am not so sure about the older versions.
I see. I have looked into the VAD system of ReactOS and it seems that they do set the accessible memory at some point. Always had the impression that Windows XP had the /LARGEADDRESSAWARE flag work.
Michael Long wrote: regarding 3)
From the research I have done I haven't found a way to do this after Windows has booted/without using the boot options. But of course I don't know everything.
Thanks! I did research aswell and came to the same conclusion. Memory management is too native to manipulate. But it would be great if ReactOS had the support because I would gladly add special functionality if my executable were run on it. ^^
Michael Long wrote: In general: If you need more memory then there are other ways. Especially if you like to use something like 10 GB in Windows 32 bit or 64 bit you can't work with a 3 GB or 4 GB user space alone anyway. You might want to look into other ways like address windowing extension (AWE) or using several 4 GB segments.
Nah, I am fine with the amount of memory. I was researching the PE file format so wanted to see if I could parametrize the /LARGEADDRESSWARE flag at loading. But yea, no API exported for that. Too native. The ship has sunk...

Thank you for the reply, by the way! I have seen your private message that you have deleted... That made me aware.

middings
Posts: 1028
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: /LARGEADDRESSAWARE

Post by middings »

The_GTA wrote:3) Is there API to enable /LARGEADDRESSAWARE during process runtime from user-mode? (NT api, Win32 api, etc)
There is no API for that. Raymond Chen of Microsoft discusses this in his post "Can I enable Large Address Awareness dynamically at runtime?" at his blog, The Old New Thing. He describes a possible workaround for those who wish to choose the state of /LARGEADDRESSAWARE at program load time. Raymond admits, "Yes, it's a bit clunky, but at least it's do-able."

Notes:
1. Nothing on Raymond's blog is official Microsoft documentation, he says his blog is "for entertainment purposes only".
2. "Feature-flighting" appears to be Microspeak for what is more commonly known as feature toggling or feature flagging.

Post Reply

Who is online

Users browsing this forum: karlexceed and 1 guest