View Single Post
  #63  
Old February 6th 04, 06:59 AM
Nick Savoiu
external usenet poster
 
Posts: n/a
Default No memory although more than 1GB free

"Klaus Bonadt" wrote in message
...
It seems that you could have that case. You could try to walk the

virtual
address space and see what's going on. Check out VirtualQueryEx().


DWORD VirtualQuery(
LPCVOID lpAddress, // address of region
PMEMORY_BASIC_INFORMATION lpBuffer, // information buffer
SIZE_T dwLength // size of buffer
);

Two questions:
1.
How to set lpAddress initially?


You can start it at 0 and then increment it based on the info returned in
lpBuffer (i.e. look up MEMORY_BASIC_INFORMATION).

2.
I will collect sets of memory regions with different attributes. However,

I
do not know how to interpret these sets.
Furthermore, I guess I will end up with the same amount of memory, which
"Process viewer" is presenting.


Yes, but this will give you more info than a simple sum. To understand what
you're being given again see MEMORY_BASIC_INFORMATION.

BTW, what failture code to you get from the allocation functions that you
call?

HTH,
Nick


Ads