[ros-diffs] [ion] 22552: - 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).

ion at svn.reactos.org ion at svn.reactos.org
Sat Jun 24 01:10:59 CEST 2006


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?rev=22552&r1=22551&r2=22552&view=diff
==============================================================================
--- 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 at 16
 RtlGetSecurityDescriptorRMControl at 8
 RtlGetSetBootStatusData at 24
-;RtlGetUserInfoHeap
+RtlGetUserInfoHeap at 20
 RtlGetVersion at 4
 RtlHashUnicodeString at 16
 RtlIdentifierAuthoritySid at 4
@@ -638,7 +638,7 @@
 RtlSetTimeZoneInformation at 4
 ;RtlSetUnicodeCallouts
 ;RtlSetUserFlagsHeap
-;RtlSetUserValueHeap
+RtlSetUserValueHeap at 16
 RtlSizeHeap at 12
 RtlSplay at 4
 ;RtlStartRXact

Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev=22552&r1=22551&r2=22552&view=diff
==============================================================================
--- 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&r1=22551&r2=22552&view=diff
==============================================================================
--- 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 */




More information about the Ros-diffs mailing list