[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.

svn path=/trunk/; revision=49063
This commit is contained in:
Aleksey Bragin 2010-10-09 09:15:50 +00:00
parent 46819fb8ac
commit a87de8e0b6
3 changed files with 1 additions and 32 deletions

View file

@ -101,7 +101,6 @@ GlobalAlloc(UINT uFlags,
{ {
/* All worked well, save our heap entry */ /* All worked well, save our heap entry */
RtlSetUserValueHeap(hProcessHeap, HEAP_NO_SERIALIZE, Ptr, hMemory); RtlSetUserValueHeap(hProcessHeap, HEAP_NO_SERIALIZE, Ptr, hMemory);
RtlSetUserFlagsHeap(hProcessHeap, HEAP_NO_SERIALIZE, Ptr, Flags);
} }
} }
@ -529,10 +528,6 @@ GlobalReAlloc(HGLOBAL hMem,
HEAP_NO_SERIALIZE, HEAP_NO_SERIALIZE,
Ptr, Ptr,
hMem); hMem);
RtlSetUserFlagsHeap(hProcessHeap,
HEAP_NO_SERIALIZE,
Ptr,
Flags);
} }
} }
else else
@ -562,10 +557,6 @@ GlobalReAlloc(HGLOBAL hMem,
HEAP_NO_SERIALIZE, HEAP_NO_SERIALIZE,
Ptr, Ptr,
hMem); hMem);
RtlSetUserFlagsHeap(hProcessHeap,
HEAP_NO_SERIALIZE,
Ptr,
Flags);
} }
} }
@ -668,10 +659,6 @@ GlobalReAlloc(HGLOBAL hMem,
HEAP_NO_SERIALIZE, HEAP_NO_SERIALIZE,
HandleEntry->Object, HandleEntry->Object,
hMem); hMem);
RtlSetUserFlagsHeap(hProcessHeap,
HEAP_NO_SERIALIZE,
HandleEntry->Object,
Flags);
} }
} }
} }

View file

@ -352,11 +352,6 @@ LocalReAlloc(HLOCAL hMem,
HEAP_NO_SERIALIZE, HEAP_NO_SERIALIZE,
Ptr, Ptr,
hMem); hMem);
RtlSetUserFlagsHeap(hProcessHeap,
HEAP_NO_SERIALIZE,
Ptr,
Flags);
} }
} }
else else
@ -378,19 +373,6 @@ LocalReAlloc(HLOCAL hMem,
/* And do the re-allocation */ /* And do the re-allocation */
Ptr = RtlReAllocateHeap(hProcessHeap, Flags, Ptr, dwBytes); 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 */ /* Make sure we have a pointer by now */

View file

@ -805,7 +805,7 @@ CreateProcessInternalW(HANDLE hToken,
if (lpCommandLine) if (lpCommandLine)
{ {
/* Serach for escape sequences */ /* Search for escape sequences */
ScanString = lpCommandLine; ScanString = lpCommandLine;
while (NULL != (ScanString = wcschr(ScanString, L'^'))) while (NULL != (ScanString = wcschr(ScanString, L'^')))
{ {