The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Bill Cravener on January 17, 2009, 04:55:28 PM

Title: GlobalMemoryStatusEx Example.
Post by: Bill Cravener on January 17, 2009, 04:55:28 PM
Well here it is winter time and it's presently 4 degrees Fahrenheit here in PA. So I started digging thru the Windows API SDK again for something to play with and found the GlobalMemoryStatusEx API. Now I have used and played with the GlobalMemoryStatus API before but the extended version is a bit different. Who would of thunk that computers would be hauling over 2  GB of onboard RAM?

Anyway, I did a good search both here on this board and also on that other board for an example on using the GlobalMemoryStatusEx API but found nothing. So I slapped this example together so I could see just how this API does things.

I do have one question about the MEMORYSTATUSEX Structure value ullAvailExtendedVirtual. The SDK says it is "The amount of unreserved and uncommitted memory currently in the extended portion of the virtual address space of the calling process, in bytes."

What is this unreserved and uncommitted memory in the extended portion of the virtual address space of the calling process? I've tested this example on various machines and ullAvailExtendedVirtual always states a zero value.

I would like to apologize for not commenting the asm source code but it's a pretty simple example to follow.  :bg




[attachment deleted by admin]
Title: Re: GlobalMemoryStatusEx Example.
Post by: evlncrn8 on January 17, 2009, 05:32:11 PM
ullAvailExtendedVirtual

    Reserved. This value is always 0.

says so on msdn :)

http://msdn.microsoft.com/en-us/library/aa366770(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa366589.aspx
Title: Re: GlobalMemoryStatusEx Example.
Post by: Bill Cravener on January 17, 2009, 06:31:50 PM
I have the latest SDK and it states that ullAvailExtendedVirtual is the amount of unreserved and uncommitted memory currently in the extended portion of the virtual address space of the calling process, in bytes.

But what is this "extended portion" of the virtual address space of the calling process? (http://www.quickersoft.com/thinking.gif)
Title: Re: GlobalMemoryStatusEx Example.
Post by: sinsi on January 19, 2009, 09:15:43 AM
Yeah, from the windows7 sdk:
QuoteullAvailExtendedVirtual
Reserved. This value is always 0.
Title: Re: GlobalMemoryStatusEx Example.
Post by: Bill Cravener on January 19, 2009, 11:13:05 AM
I have SDK for Windows Server 2008 v6.1 I believe which stated the above about ullAvailExtendedVirtual so it appears MS has changed this to reserved.

Thanks guys.
Title: Re: GlobalMemoryStatusEx Example.
Post by: eterzzo on March 06, 2011, 02:15:12 AM
Help, my masm32 have this
; MEMORYSTATUS STRUCT
;  dwLength          DWORD      ?
;  dwMemoryLoad      DWORD      ?
;  dwTotalPhys       DWORD      ?
;  dwAvailPhys       DWORD      ?
;  dwTotalPageFile   DWORD      ?
;  dwAvailPageFile   DWORD      ?
;  dwTotalVirtual    DWORD      ?
;  dwAvailVirtual    DWORD      ?
and return "totalPhys" F5CE1C9C ,  I have only 448 MB. ??
I wrong?, thanks
Title: Re: GlobalMemoryStatusEx Example.
Post by: jj2007 on March 06, 2011, 04:23:22 AM
Quote from: eterzzo on March 06, 2011, 02:15:12 AM
I wrong?, thanks

Yes. And if you post at least that tiny bit of code that starts with "invoke", we might even tell you why you are wrong.

Welcome to the forum :thumbu
Title: Re: GlobalMemoryStatusEx Example.
Post by: redskull on March 06, 2011, 07:14:40 PM
Quote from: Bill Cravener on January 17, 2009, 06:31:50 PM
But what is this "extended portion" of the virtual address space of the calling process? (http://www.quickersoft.com/thinking.gif)

My gut feeling would be they are talking about the Address Windowing Extensions, but i have nothing to back that up.  Apparently they got rid of it anyhow.

-r