mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +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:
parent
70bb5d0a00
commit
94322ba2cb
1 changed files with 10 additions and 7 deletions
|
@ -19,16 +19,19 @@ EngAllocMem(ULONG Flags,
|
||||||
ULONG MemSize,
|
ULONG MemSize,
|
||||||
ULONG Tag)
|
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)
|
if (newMem == NULL)
|
||||||
{
|
return NULL;
|
||||||
RtlZeroMemory(newMem, MemSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newMem;
|
if (Flags & FL_ZERO_MEMORY)
|
||||||
|
RtlZeroMemory(newMem, MemSize);
|
||||||
|
|
||||||
|
return newMem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue