Page 1 of 1

Finding all memory connected to a given process

Posted: Thu Dec 15, 2005 2:37 pm
by sybixsus
I'm using VirtualQueryEx() to find which areas of memory are available to which processes but I'm finding I either get more blocks than I need, or not enough. I found a thread on these forums which suggested limiting the blocks to those where the mbi.lType is MEM_PRIVATE and the mbi.State is MEM_COMMIT but this discards important blocks of memory which the process is using ( yes, I'm 100% certain. )

So I tried cutting out the MEM_PRIVATE and just reading those blocks which are MEM_COMMIT, but that gives me a lot of false positives. It doesn't give me anything which causes an access violation, but it does slow things down by making me trawl through memory I don't really need to check.

Is there a better way to focus my search?