Author: hpoussin
Date: Wed Mar 3 23:35:10 2010
New Revision: 45811
URL:
http://svn.reactos.org/svn/reactos?rev=45811&view=rev
Log:
[freeldr] Add some more memory management functions
Modified:
trunk/reactos/boot/freeldr/freeldr/include/mm.h
trunk/reactos/boot/freeldr/freeldr/mm/mm.c
Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Wed Mar 3 23:35:10 2010
@@ -116,3 +116,7 @@
PVOID MmHeapAlloc(ULONG MemorySize);
VOID MmHeapFree(PVOID MemoryPointer);
+
+#define ExAllocatePool(pool, size) MmHeapAlloc(size)
+#define ExAllocatePoolWithTag(pool, size, tag) MmHeapAlloc(size)
+#define ExFreePool(p) MmHeapFree(p)
Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Wed Mar 3 23:35:10 2010
@@ -345,3 +345,54 @@
return RealPageLookupTable;
}
+
+#undef ExAllocatePoolWithTag
+NTKERNELAPI
+PVOID
+NTAPI
+ExAllocatePoolWithTag(
+ IN POOL_TYPE PoolType,
+ IN SIZE_T NumberOfBytes,
+ IN ULONG Tag)
+{
+ return MmHeapAlloc(NumberOfBytes);
+}
+
+#undef ExFreePool
+NTKERNELAPI
+VOID
+NTAPI
+ExFreePool(
+ IN PVOID P)
+{
+ MmHeapFree(P);
+}
+
+PVOID
+NTAPI
+RtlAllocateHeap(
+ IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN SIZE_T Size)
+{
+ PVOID ptr;
+
+ ptr = MmHeapAlloc(Size);
+ if (ptr && (Flags & HEAP_ZERO_MEMORY))
+ {
+ RtlZeroMemory(ptr, Size);
+ }
+
+ return ptr;
+}
+
+BOOLEAN
+NTAPI
+RtlFreeHeap(
+ IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN PVOID HeapBase)
+{
+ MmHeapFree(HeapBase);
+ return TRUE;
+}