The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: jdoe on December 18, 2008, 02:15:28 PM

Title: HeapReAlloc failure
Post by: jdoe on December 18, 2008, 02:15:28 PM

Hi,

I can't find the answer for that "simple" question...

What happen to the original memory block if I call HeapReAlloc and it fails. Does the original block stay unchanged and still exist ?

Title: Re: HeapReAlloc failure
Post by: MichaelW on December 18, 2008, 02:51:52 PM
Per the PSDK:
QuoteIf HeapReAlloc fails, the original memory is not freed, and the original handle and pointer are still valid.

I would guess that the memory contents would be preserved. I doubt that the function would go about changing the memory before determining if reallocation was possible.

Title: Re: HeapReAlloc failure
Post by: jdoe on December 18, 2008, 03:00:50 PM

Shame on me. I sticked to the Return value section and forgot the Remarks. I searched the web when the answer was just few lines below where I was first.

Sorry   :red