Author: cgutman
Date: Sat Dec 17 08:35:31 2011
New Revision: 54669
URL:
http://svn.reactos.org/svn/reactos?rev=54669&view=rev
Log:
[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
Modified:
trunk/reactos/subsystems/win32/win32k/eng/mem.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/mem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/mem.c [iso-8859-1] Sat Dec 17 08:35:31 2011
@@ -19,16 +19,19 @@
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;
}
/*