EngAllocMem:
 - Respect the FL_NONPAGED_MEMORY flag (actually allocate the memory from non-paged pool)
 - Fix an improper flag comparison that caused memory allocated with both FL_NONPAGED_MEMORY and FL_ZERO_MEMORY set to not be zeroed as requested

svn path=/trunk/; revision=54669
This commit is contained in:
Cameron Gutman 2011-12-17 08:35:31 +00:00
parent 70bb5d0a00
commit 94322ba2cb

View file

@ -19,16 +19,19 @@ EngAllocMem(ULONG Flags,
ULONG MemSize,
ULONG Tag)
{
PVOID newMem;
PVOID newMem;
newMem = ExAllocatePoolWithTag(PagedPool, MemSize, Tag);
newMem = ExAllocatePoolWithTag((Flags & FL_NONPAGED_MEMORY) ? NonPagedPool : PagedPool,
MemSize,
Tag);
if (Flags == FL_ZERO_MEMORY && NULL != newMem)
{
RtlZeroMemory(newMem, MemSize);
}
if (newMem == NULL)
return NULL;
return newMem;
if (Flags & FL_ZERO_MEMORY)
RtlZeroMemory(newMem, MemSize);
return newMem;
}
/*