Author: ion
Date: Sat Jun 24 03:10:58 2006
New Revision: 22552
URL:
http://svn.reactos.org/svn/reactos?rev=22552&view=rev
Log:
- Hackplement RtlSetUserValueHeap and RtlGetUserInfoHeap, they are needed for being able
to build higher-level heap management around the Heap APIs (either for developers or the
OS). Case in point, needed for my Global* rewrite in kernel32. The current APIs are utter
hacks, but they work (eventually we should get rid of the Wine Windows 95 heap
implementation and replace it).
Modified:
trunk/reactos/dll/ntdll/def/ntdll.def
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/lib/rtl/heap.c
Modified: trunk/reactos/dll/ntdll/def/ntdll.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?re…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.def (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.def Sat Jun 24 03:10:58 2006
@@ -482,7 +482,7 @@
RtlGetSaclSecurityDescriptor@16
RtlGetSecurityDescriptorRMControl@8
RtlGetSetBootStatusData@24
-;RtlGetUserInfoHeap
+RtlGetUserInfoHeap@20
RtlGetVersion@4
RtlHashUnicodeString@16
RtlIdentifierAuthoritySid@4
@@ -638,7 +638,7 @@
RtlSetTimeZoneInformation@4
;RtlSetUnicodeCallouts
;RtlSetUserFlagsHeap
-;RtlSetUserValueHeap
+RtlSetUserValueHeap@16
RtlSizeHeap@12
RtlSplay@4
;RtlStartRXact
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h Sat Jun 24 03:10:58 2006
@@ -496,6 +496,16 @@
HANDLE *HeapArray
);
+BOOLEAN
+NTAPI
+RtlGetUserInfoHeap(
+ IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN PVOID BaseAddress,
+ OUT PVOID *UserValue,
+ OUT PULONG UserFlags
+);
+
NTSYSAPI
PVOID
NTAPI
@@ -515,6 +525,15 @@
BOOLEAN
NTAPI
RtlUnlockHeap(IN HANDLE Heap);
+
+BOOLEAN
+NTAPI
+RtlSetUserValueHeap(
+ IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN PVOID BaseAddress,
+ IN PVOID UserValue
+);
NTSYSAPI
ULONG
Modified: trunk/reactos/lib/rtl/heap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap.c?rev=22552&a…
==============================================================================
--- trunk/reactos/lib/rtl/heap.c (original)
+++ trunk/reactos/lib/rtl/heap.c Sat Jun 24 03:10:58 2006
@@ -100,6 +100,7 @@
RTL_CRITICAL_SECTION critSection; /* Critical section for serialization */
ULONG flags; /* Heap flags */
ULONG magic; /* Magic number */
+ PVOID UserValue;
PRTL_HEAP_COMMIT_ROUTINE commitRoutine;
}
HEAP, *PHEAP;
@@ -1843,4 +1844,40 @@
return FALSE;
}
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+RtlSetUserValueHeap(IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN PVOID BaseAddress,
+ IN PVOID UserValue)
+{
+ HEAP *heapPtr = HEAP_GetPtr(HeapHandle);
+
+ /* Hack */
+ heapPtr->UserValue = UserValue;
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+RtlGetUserInfoHeap(IN PVOID HeapHandle,
+ IN ULONG Flags,
+ IN PVOID BaseAddress,
+ OUT PVOID *UserValue,
+ OUT PULONG UserFlags)
+{
+ HEAP *heapPtr = HEAP_GetPtr(HeapHandle);
+
+ /* Hack */
+ if (UserValue) *UserValue = heapPtr->UserValue;
+ if (UserFlags) *UserFlags = heapPtr->flags & HEAP_SETTABLE_USER_FLAGS;
+ return TRUE;
+}
+
/* EOF */