Re: CreateToolhelp32Snapshot



A snapshot tries to reserve 1MB of virtual memory. If it can't, or can't commit the first page (or n pages), then you'll get ERROR_NOT_ENOUGH_MEMORY.

My first guess is that you don't have 1MB of contiguous virtual address space in your 32MB process slot, so the reservation is failing.

--
Michael Salamone, eMVP
Entrek Software, Inc.
www.entrek.com


"Yudi" <yudilevi@xxxxxxxxx> wrote in message news:1177861144.662279.324330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I'm using the CreateToolhelp32Snapshot in order to enumerate all the
processes in the system and sometimes the function fails on WM5.0 with
error ERROR_NOT_ENOUGH_MEMORY. I tried adding the TH32CS_SNAPNOHEAPS
flag, which did help - now the function only fails 1 out of 30 of the
times, but it still fails.

I'm basically trying to find out if a certain process is currently
running and this seemed like the most reliable way to check that, but
I can't find a way to make it work without errors.

Any idea how to fix that?

Regards,
Yudi


.



Relevant Pages

  • Re: Virtual memory usage with XP
    ... On virtual memory, from the late MVP Alex Nichol: ... Windows help - www.rickrogers.org ... so I said that having a pagefile larger than 2GB would not ... Is it the reserve that extends beyond 4GB? ...
    (microsoft.public.windowsxp.general)
  • Re: Newbie: allocating aligned physically-contiguous memory?
    ... the kernel at startup to reserve the upper 4MB for two framebuffers, and then just ioremap'ing both of those blocks into virtual memory. ...
    (comp.os.linux.development.system)
  • Increase vmalloc size on kernel >=2.4.27
    ... is there a way to reserve more than 128MB of virtual memory on a i386 ... machine with kernel>=2.4.27 and 1GB of RAM? ...
    (Linux-Kernel)
  • Re: ebay psychology
    ... Sometimes when a reserved item fails to sell the seller will relist it ... as "no reserve" but set the starting price at the level of the previous ...
    (uk.rec.engines.stationary)
  • MTD_CK804XROM warning (Was: Linux 2.6.29-rc6)
    ... Your kernel is fine.Modules ... Try to reserve the window mem region. ... If this fails then ... discovered we will try to reserve the unreserved fragment. ...
    (Linux-Kernel)

Quantcast