[ros-diffs] [fireball] 49063: [KERNEL32] - Revert incorrect changes from 34404 and 40910: RtlSetUserFlagsHeap() doesn't set usual heap flags, it sets special user-settable heap entry flags. With the new heap m...

fireball at svn.reactos.org fireball at svn.reactos.org
Sat Oct 9 09:15:52 UTC 2010


Author: fireball
Date: Sat Oct  9 09:15:50 2010
New Revision: 49063

URL: http://svn.reactos.org/svn/reactos?rev=49063&view=rev
Log:
[KERNEL32]
- Revert incorrect changes from 34404 and 40910: RtlSetUserFlagsHeap() doesn't set usual heap flags, it sets special user-settable heap entry flags. With the new heap manager such usage corrupts heap integrity (not to say prototype of this function is incorrect).
- RtlReAllocateHeap() is supposed to copy user values and flags so there is no need to set them afterwise again.
- Fix a typo in comments.

Modified:
    trunk/reactos/dll/win32/kernel32/mem/global.c
    trunk/reactos/dll/win32/kernel32/mem/local.c
    trunk/reactos/dll/win32/kernel32/process/procsup.c

Modified: trunk/reactos/dll/win32/kernel32/mem/global.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/global.c?rev=49063&r1=49062&r2=49063&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/global.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/global.c [iso-8859-1] Sat Oct  9 09:15:50 2010
@@ -101,7 +101,6 @@
         {
             /* All worked well, save our heap entry */
             RtlSetUserValueHeap(hProcessHeap, HEAP_NO_SERIALIZE, Ptr, hMemory);
-            RtlSetUserFlagsHeap(hProcessHeap, HEAP_NO_SERIALIZE, Ptr, Flags);
         }
     }
 
@@ -529,10 +528,6 @@
                                             HEAP_NO_SERIALIZE,
                                             Ptr,
                                             hMem);
-                        RtlSetUserFlagsHeap(hProcessHeap,
-                                            HEAP_NO_SERIALIZE,
-                                            Ptr,
-                                            Flags);
                     }
                 }
                 else
@@ -562,10 +557,6 @@
                                             HEAP_NO_SERIALIZE,
                                             Ptr,
                                             hMem);
-                        RtlSetUserFlagsHeap(hProcessHeap,
-                                            HEAP_NO_SERIALIZE,
-                                            Ptr,
-                                            Flags);
                     }
 
                 }
@@ -668,10 +659,6 @@
                                         HEAP_NO_SERIALIZE,
                                         HandleEntry->Object,
                                         hMem);
-                    RtlSetUserFlagsHeap(hProcessHeap,
-                                        HEAP_NO_SERIALIZE,
-                                        HandleEntry->Object,
-                                        Flags);
                 }
             }
         }

Modified: trunk/reactos/dll/win32/kernel32/mem/local.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/local.c?rev=49063&r1=49062&r2=49063&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/local.c [iso-8859-1] Sat Oct  9 09:15:50 2010
@@ -352,11 +352,6 @@
                                             HEAP_NO_SERIALIZE,
                                             Ptr,
                                             hMem);
-                        RtlSetUserFlagsHeap(hProcessHeap,
-                                            HEAP_NO_SERIALIZE,
-                                            Ptr,
-                                            Flags);
-
                     }
                 }
                 else
@@ -378,19 +373,6 @@
 
                     /* 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/process/procsup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/procsup.c?rev=49063&r1=49062&r2=49063&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Sat Oct  9 09:15:50 2010
@@ -805,7 +805,7 @@
 
     if (lpCommandLine)
     {
-        /* Serach for escape sequences */
+        /* Search for escape sequences */
         ScanString = lpCommandLine;
         while (NULL != (ScanString = wcschr(ScanString, L'^')))
         {




More information about the Ros-diffs mailing list