Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use VirtualQuery

1 view
Skip to first unread message

Kennet

unread,
Oct 19, 2002, 6:09:04 AM10/19/02
to
Hey all

I am trying to finde the memory size of a loaded DLL I have been told to use
VirtualQuery.
But I can't figure out how to use the information returned.
The RegionSize member does not seem to be the total size, compared to the
value seen in "Process Explorer" from www.sysinternals.com.

Do I need to do some extra processing or what ?

Thanks.

Kennet

unread,
Oct 19, 2002, 7:22:17 AM10/19/02
to
I think I figured it out
what I did was.

LPCVOID lpAddress = hInstPlugin;
while( VirtualQuery( lpAddress , &stMemInfo , sizeof( stMemInfo )) )
{
if( stMemInfo.AllocationBase != hInstPlugin || stMemInfo.State ==
MEM_FREE )
break;
dwMemSize += stMemInfo.RegionSize;
lpAddress = (char *)lpAddress + stMemInfo.RegionSize;
}

"Kennet" <Kenn...@nospam.ofir.dk> wrote in message
news:3db12f3e$0$773$ba62...@nntp03.dk.telia.net...

0 new messages