Author: mjmartin
Date: Wed May 13 13:48:32 2009
New Revision: 40910
URL: 
http://svn.reactos.org/svn/reactos?rev=40910&view=rev
Log:
- GlobalReAlloc: SetUserValueHeap and SetUserFlagsHeap after RtlReAllocateHeap.
- LocalReAlloc: Add missing SetUserFlagsHeap after RtlAllocateHeap.
                SetUserValueHeap and SetUserFlagsHeap after RtlReAllocateHeap.
Modified:
    trunk/reactos/dll/win32/kernel32/mem/global.c
    trunk/reactos/dll/win32/kernel32/mem/local.c
Modified: trunk/reactos/dll/win32/kernel32/mem/global.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/glo…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/global.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/global.c [iso-8859-1] Wed May 13 13:48:32 2009
@@ -547,6 +547,20 @@
                     /* And do the re-allocation */
                     Ptr = RtlReAllocateHeap(hProcessHeap, Flags, Ptr, dwBytes);
+
+                    if (Ptr)
+                    {
+                        /* Allocation succeeded, so save our entry */
+                        RtlSetUserValueHeap(hProcessHeap,
+                                            HEAP_NO_SERIALIZE,
+                                            Ptr,
+                                            hMem);
+                        RtlSetUserFlagsHeap(hProcessHeap,
+                                            HEAP_NO_SERIALIZE,
+                                            Ptr,
+                                            Flags);
+                    }
+
                 }
                 /* Make sure we have a pointer by now */
Modified: trunk/reactos/dll/win32/kernel32/mem/local.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/loc…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] Wed May 13 13:48:32 2009
@@ -354,6 +354,11 @@
                                             HEAP_NO_SERIALIZE,
                                             Ptr,
                                             hMem);
+                        RtlSetUserFlagsHeap(hProcessHeap,
+                                            HEAP_NO_SERIALIZE,
+                                            Ptr,
+                                            Flags);
+
                     }
                 }
                 else
@@ -375,6 +380,19 @@
                     /* And do the re-allocation */
                     Ptr = RtlReAllocateHeap(hProcessHeap, Flags, Ptr, dwBytes);
+
+                    if (Ptr)
+                    {
+                        /* Allocation succeeded, so save our entry */
+                        RtlSetUserValueHeap(hProcessHeap,
+                                            HEAP_NO_SERIALIZE,
+                                            Ptr,
+                                            hMem);
+                        RtlSetUserFlagsHeap(hProcessHeap,
+                                            HEAP_NO_SERIALIZE,
+                                            Ptr,
+                                            Flags);
+                    }
                 }
                 /* Make sure we have a pointer by now */