Author: fireball
Date: Thu Feb 10 18:21:53 2011
New Revision: 50654
URL:
http://svn.reactos.org/svn/reactos?rev=50654&view=rev
Log:
- Add stubs for all page heap API functions.
- Enable call to RtlpPageHeapDestroy() when necessary.
- Reset Parameters==-1 hack after unsuccessful call to RtlpPageHeapCreate(), would be
necessary when page heap is implemented..
Modified:
trunk/reactos/lib/rtl/heap.c
trunk/reactos/lib/rtl/heap.h
trunk/reactos/lib/rtl/heappage.c
Modified: trunk/reactos/lib/rtl/heap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.c?rev=50654&a…
==============================================================================
--- trunk/reactos/lib/rtl/heap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heap.c [iso-8859-1] Thu Feb 10 18:21:53 2011
@@ -1364,6 +1364,10 @@
//ASSERT(FALSE);
DPRINT1("Enabling page heap failed\n");
+
+ /* Reset a special Parameters == -1 hack */
+ if ((ULONG_PTR)Parameters == (ULONG_PTR)-1)
+ Parameters = NULL;
}
/* Check validation flags */
@@ -1715,6 +1719,9 @@
PHEAP_SEGMENT Segment;
if (!HeapPtr) return NULL;
+
+ /* Call page heap routine if required */
+ if (Heap->ForceFlags & HEAP_FLAG_PAGE_ALLOCS) return
RtlpPageHeapDestroy(HeapPtr);
/* Call special heap */
if (RtlpHeapIsSpecial(Heap->Flags))
Modified: trunk/reactos/lib/rtl/heap.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.h?rev=50654&a…
==============================================================================
--- trunk/reactos/lib/rtl/heap.h [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heap.h [iso-8859-1] Thu Feb 10 18:21:53 2011
@@ -385,6 +385,8 @@
ULONG Flags,
PVOID Ptr);
+/* heappage.c */
+
HANDLE NTAPI
RtlpPageHeapCreate(ULONG Flags,
PVOID Addr,
@@ -393,4 +395,49 @@
PVOID Lock,
PRTL_HEAP_PARAMETERS Parameters);
+PVOID NTAPI
+RtlpPageHeapDestroy(HANDLE HeapPtr);
+
+PVOID NTAPI
+RtlpPageHeapAllocate(IN PVOID HeapPtr,
+ IN ULONG Flags,
+ IN SIZE_T Size);
+
+BOOLEAN NTAPI
+RtlpPageHeapFree(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr);
+
+PVOID NTAPI
+RtlpPageHeapReAllocate(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr,
+ SIZE_T Size);
+
+BOOLEAN NTAPI
+RtlpPageHeapGetUserInfo(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ PVOID *UserValue,
+ PULONG UserFlags);
+
+BOOLEAN NTAPI
+RtlpPageHeapSetUserValue(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ PVOID UserValue);
+
+BOOLEAN
+NTAPI
+RtlpPageHeapSetUserFlags(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ ULONG UserFlagsReset,
+ ULONG UserFlagsSet);
+
+SIZE_T NTAPI
+RtlpPageHeapSize(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr);
+
#endif
Modified: trunk/reactos/lib/rtl/heappage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heappage.c?rev=506…
==============================================================================
--- trunk/reactos/lib/rtl/heappage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/heappage.c [iso-8859-1] Thu Feb 10 18:21:53 2011
@@ -36,4 +36,73 @@
return NULL;
}
+PVOID NTAPI
+RtlpPageHeapDestroy(HANDLE HeapPtr)
+{
+ return FALSE;
+}
+
+PVOID NTAPI
+RtlpPageHeapAllocate(IN PVOID HeapPtr,
+ IN ULONG Flags,
+ IN SIZE_T Size)
+{
+ return NULL;
+}
+
+BOOLEAN NTAPI
+RtlpPageHeapFree(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr)
+{
+ return FALSE;
+}
+
+PVOID NTAPI
+RtlpPageHeapReAllocate(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr,
+ SIZE_T Size)
+{
+ return NULL;
+}
+
+BOOLEAN NTAPI
+RtlpPageHeapGetUserInfo(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ PVOID *UserValue,
+ PULONG UserFlags)
+{
+ return FALSE;
+}
+
+BOOLEAN NTAPI
+RtlpPageHeapSetUserValue(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ PVOID UserValue)
+{
+ return FALSE;
+}
+
+BOOLEAN
+NTAPI
+RtlpPageHeapSetUserFlags(PVOID HeapHandle,
+ ULONG Flags,
+ PVOID BaseAddress,
+ ULONG UserFlagsReset,
+ ULONG UserFlagsSet)
+{
+ return FALSE;
+}
+
+SIZE_T NTAPI
+RtlpPageHeapSize(HANDLE HeapPtr,
+ ULONG Flags,
+ PVOID Ptr)
+{
+ return 0;
+}
+
/* EOF */