Commit 1d0598b0 authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

Swap arguments of LocalAlloc and only update Malloc32 block on

successful allocation.
parent 8d96cd31
...@@ -73,10 +73,16 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 }; ...@@ -73,10 +73,16 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
/* resize the old table */ /* resize the old table */
static int SetSpyedBlockTableLength ( int NewLength ) static int SetSpyedBlockTableLength ( int NewLength )
{ {
if (!Malloc32.SpyedBlocks) Malloc32.SpyedBlocks = (LPVOID*)LocalAlloc(NewLength, GMEM_ZEROINIT); LPVOID *NewSpyedBlocks;
else Malloc32.SpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
Malloc32.SpyedBlockTableLength = NewLength; if (!Malloc32.SpyedBlocks) NewSpyedBlocks = LocalAlloc(GMEM_ZEROINIT, NewLength);
return Malloc32.SpyedBlocks ? 1 : 0; else NewSpyedBlocks = LocalReAlloc(Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
if (NewSpyedBlocks) {
Malloc32.SpyedBlocks = NewSpyedBlocks;
Malloc32.SpyedBlockTableLength = NewLength;
}
return NewSpyedBlocks != NULL;
} }
/* add a location to the table */ /* add a location to the table */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment