News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GlobalMemoryStatusEx Example.

Started by Bill Cravener, January 17, 2009, 04:55:28 PM

Previous topic - Next topic

Bill Cravener

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]
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat


Bill Cravener

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?
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

sinsi

Yeah, from the windows7 sdk:
QuoteullAvailExtendedVirtual
Reserved. This value is always 0.
Light travels faster than sound, that's why some people seem bright until you hear them.

Bill Cravener

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.
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat

eterzzo

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

jj2007

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

redskull

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?

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
Strange women, lying in ponds, distributing swords, is no basis for a system of government