From a27a41929d3be242a359e08d0eb3900a514e08e5 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 23 Jan 2004 19:59:15 +0000 Subject: [PATCH] Ntdll implements the user heaps. Don't try to handle this yourself. svn path=/trunk/; revision=7847 --- reactos/lib/crtdll/malloc/expand.c | 34 ++---------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/reactos/lib/crtdll/malloc/expand.c b/reactos/lib/crtdll/malloc/expand.c index 780547007ad..8f1d9655004 100644 --- a/reactos/lib/crtdll/malloc/expand.c +++ b/reactos/lib/crtdll/malloc/expand.c @@ -1,31 +1,12 @@ #include -#include #include -#include /* * @implemented */ void* _expand(void* pold, size_t size) { - PHEAP_BUCKET pbucket; - PHEAP_SUBALLOC psub; - PHEAP_FRAGMENT pfrag = (PHEAP_FRAGMENT)((LPVOID)pold-HEAP_FRAG_ADMIN_SIZE); - - /* sanity checks */ - if (pfrag->Magic != HEAP_FRAG_MAGIC) - return NULL; - - /* get bucket size */ - psub = pfrag->Sub; - pbucket = psub->Bucket; - if(size <= pbucket->Size) { - pfrag->Size=size; - return pold; - } - else - return NULL; - return NULL; + return HeapReAlloc(GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, pold, size); } /* @@ -33,16 +14,5 @@ void* _expand(void* pold, size_t size) */ size_t _msize(void* pBlock) { - PHEAP_BUCKET pbucket; - PHEAP_SUBALLOC psub; - PHEAP_FRAGMENT pfrag = (PHEAP_FRAGMENT)((LPVOID)pBlock-HEAP_FRAG_ADMIN_SIZE); - - /* sanity checks */ - if (pfrag->Magic != HEAP_FRAG_MAGIC) - return 0; - - /* get bucket size */ - psub = pfrag->Sub; - pbucket = psub->Bucket; - return pbucket->Size; + return HeapSize (GetProcessHeap(), 0, pBlock); }