Set the min size of an allocated block to the size of the free block header.
authorHartmut Birr <osexpert@googlemail.com>
Thu, 14 Feb 2002 00:07:23 +0000 (00:07 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Thu, 14 Feb 2002 00:07:23 +0000 (00:07 +0000)
This fix the gditest bug.

svn path=/trunk/; revision=2623

reactos/ntoskrnl/mm/ppool.c

index 400b183..22b4b19 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ppool.c,v 1.6 2001/12/31 01:53:45 dwelch Exp $
+/* $Id: ppool.c,v 1.7 2002/02/14 00:07:23 hbirr Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -87,6 +87,11 @@ ExAllocatePagedPoolWithTag (IN       POOL_TYPE       PoolType,
    * Calculate the total number of bytes we will need.
    */
   BlockSize = NumberOfBytes + sizeof(MM_PPOOL_USED_BLOCK_HEADER);
+  if (BlockSize < sizeof(MM_PPOOL_FREE_BLOCK_HEADER))
+  {
+    /* At least we need the size of the free block header. */
+    BlockSize = sizeof(MM_PPOOL_FREE_BLOCK_HEADER);
+  }
 
   ExAcquireFastMutex(&MmPagedPoolLock);