mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 12:23:29 +00:00
[WIN32K]
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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user