How to handle STATUS_NO_MEMORY : 0xC0000017


I am using private heaps in my application.
The request to HeapAlloc using my private heap fails when the available
virtual memory is less and windows tries to increase the virtual memory

Is there any way to detect that windows is increasing the virtual memory
size, wait and then call HeapAlloc so that the request to HeapAlloc
Should I catch this exception, wait and again call HeapAlloc? Is there a
better way to do this?


Mandar G. Nanivadekar,
HP Storage Lab,
IInd Floor, Hulkul Brigade,
82, Lavelle Road,
Bangalore - 1