Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 201 of file ifs.c.
{ LPVOID pNewMemory; TRACE("(%p,%d)\n",pv,cb); if(Malloc32.pSpy) { LPVOID pRealMemory; BOOL fSpyed; EnterCriticalSection(&IMalloc32_SpyCS); fSpyed = RemoveMemoryLocation(pv); cb = IMallocSpy_PreRealloc(Malloc32.pSpy, pv, cb, &pRealMemory, fSpyed); /* check if can release the spy */ if(Malloc32.SpyReleasePending && !Malloc32.SpyedAllocationsLeft) { IMallocSpy_Release(Malloc32.pSpy); Malloc32.SpyReleasePending = FALSE; Malloc32.pSpy = NULL; } if (0==cb) { /* PreRealloc can force Realloc to fail */ LeaveCriticalSection(&IMalloc32_SpyCS); return NULL; } pv = pRealMemory; } if (!pv) pNewMemory = HeapAlloc(GetProcessHeap(),0,cb); else if (cb) pNewMemory = HeapReAlloc(GetProcessHeap(),0,pv,cb); else { HeapFree(GetProcessHeap(),0,pv); pNewMemory = NULL; } if(Malloc32.pSpy) { pNewMemory = IMallocSpy_PostRealloc(Malloc32.pSpy, pNewMemory, TRUE); if (pNewMemory) AddMemoryLocation(pNewMemory); LeaveCriticalSection(&IMalloc32_SpyCS); } TRACE("--(%p)\n",pNewMemory); return pNewMemory; }