Allocate memory for the handle table from paged pool!

svn path=/trunk/; revision=11158
This commit is contained in:
Filip Navara 2004-10-02 16:48:12 +00:00
parent 8e9f6624d1
commit a73f47bd18

View file

@ -19,7 +19,7 @@
/* /*
* GDIOBJ.C - GDI object manipulation routines * GDIOBJ.C - GDI object manipulation routines
* *
* $Id: gdiobj.c,v 1.72 2004/09/29 03:36:52 arty Exp $ * $Id: gdiobj.c,v 1.73 2004/10/02 16:48:12 navaraf Exp $
* *
*/ */
#include <w32k.h> #include <w32k.h>
@ -194,10 +194,8 @@ GDIOBJ_iAllocHandleTable (WORD Size)
MemSize = sizeof(GDI_HANDLE_TABLE) + sizeof(PGDIOBJ) * Size; MemSize = sizeof(GDI_HANDLE_TABLE) + sizeof(PGDIOBJ) * Size;
/* prevent APC delivery for the *FastMutexUnsafe calls */ ExAcquireFastMutex(&HandleTableMutex);
const KIRQL PrevIrql = KfRaiseIrql(APC_LEVEL); handleTable = ExAllocatePoolWithTag(PagedPool, MemSize, TAG_GDIHNDTBLE);
ExAcquireFastMutexUnsafe (&HandleTableMutex);
handleTable = ExAllocatePoolWithTag(NonPagedPool, MemSize, TAG_GDIHNDTBLE);
ASSERT( handleTable ); ASSERT( handleTable );
memset (handleTable, 0, MemSize); memset (handleTable, 0, MemSize);
#if GDI_COUNT_OBJECTS #if GDI_COUNT_OBJECTS
@ -205,14 +203,13 @@ GDIOBJ_iAllocHandleTable (WORD Size)
#endif #endif
handleTable->wTableSize = Size; handleTable->wTableSize = Size;
handleTable->AllocationHint = 1; handleTable->AllocationHint = 1;
handleTable->LookasideLists = ExAllocatePoolWithTag(NonPagedPool, handleTable->LookasideLists = ExAllocatePoolWithTag(PagedPool,
OBJTYPE_COUNT * sizeof(PAGED_LOOKASIDE_LIST), OBJTYPE_COUNT * sizeof(PAGED_LOOKASIDE_LIST),
TAG_GDIHNDTBLE); TAG_GDIHNDTBLE);
if (NULL == handleTable->LookasideLists) if (NULL == handleTable->LookasideLists)
{ {
ExFreePool(handleTable); ExFreePool(handleTable);
ExReleaseFastMutexUnsafe (&HandleTableMutex); ExReleaseFastMutex(&HandleTableMutex);
KfLowerIrql(PrevIrql);
return NULL; return NULL;
} }
for (ObjType = 0; ObjType < OBJTYPE_COUNT; ObjType++) for (ObjType = 0; ObjType < OBJTYPE_COUNT; ObjType++)
@ -220,8 +217,7 @@ GDIOBJ_iAllocHandleTable (WORD Size)
ExInitializePagedLookasideList(handleTable->LookasideLists + ObjType, NULL, NULL, 0, ExInitializePagedLookasideList(handleTable->LookasideLists + ObjType, NULL, NULL, 0,
ObjSizes[ObjType].Size + sizeof(GDIOBJHDR), TAG_GDIOBJ, 0); ObjSizes[ObjType].Size + sizeof(GDIOBJHDR), TAG_GDIOBJ, 0);
} }
ExReleaseFastMutexUnsafe (&HandleTableMutex); ExReleaseFastMutex(&HandleTableMutex);
KfLowerIrql(PrevIrql);
return handleTable; return handleTable;
} }