Print debug message if memory allocation fails

svn path=/trunk/; revision=7006
This commit is contained in:
Gé van Geldorp 2003-12-13 21:11:53 +00:00
parent 87219b9874
commit d15b8ab119
2 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* $Id: npool.c,v 1.77 2003/10/23 18:43:36 hbirr Exp $
/* $Id: npool.c,v 1.78 2003/12/13 21:11:53 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1543,6 +1543,11 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller)
block = ExAllocateWholePageBlock(Size);
KeReleaseSpinLock(&MmNpoolLock, oldIrql);
if (NULL == block)
{
DPRINT1("Trying to allocate %lu bytes from nonpaged pool - nothing suitable found, returning NULL\n",
Size );
}
return(block);
#else /* not WHOLE_PAGE_ALLOCATIONS */
@ -1600,6 +1605,8 @@ ExAllocateNonPagedPoolWithTag(ULONG Type, ULONG Size, ULONG Tag, PVOID Caller)
if (best == NULL)
{
KeReleaseSpinLock(&MmNpoolLock, oldIrql);
DPRINT1("Trying to allocate %lu bytes from nonpaged pool - nothing suitable found, returning NULL\n",
Size );
return NULL;
}
best->Used.Tag = Tag;

View file

@ -1,4 +1,4 @@
/* $Id: ppool.c,v 1.21 2003/10/20 18:43:11 ekohl Exp $
/* $Id: ppool.c,v 1.22 2003/12/13 21:11:53 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -308,7 +308,8 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType,
*/
if (BestBlock == NULL)
{
DPRINT("ExAllocatePagedPoolWithTag() - nothing suitable found, returning NULL\n" );
DPRINT1("Trying to allocate %lu bytes from paged pool - nothing suitable found, returning NULL\n",
NumberOfBytes );
ExReleaseFastMutex(&MmPagedPoolLock);
return(NULL);
}