- GlobalReAlloc: SetUserValueHeap and SetUserFlagsHeap after RtlReAllocateHeap.

- LocalReAlloc: Add missing SetUserFlagsHeap after RtlAllocateHeap. 
                SetUserValueHeap and SetUserFlagsHeap after RtlReAllocateHeap.

svn path=/trunk/; revision=40910
This commit is contained in:
Michael Martin 2009-05-13 09:48:32 +00:00
parent 0931b86d7c
commit 4832f465f1
2 changed files with 32 additions and 0 deletions

View file

@ -547,6 +547,20 @@ GlobalReAlloc(HGLOBAL hMem,
/* 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 */

View file

@ -354,6 +354,11 @@ LocalReAlloc(HLOCAL hMem,
HEAP_NO_SERIALIZE,
Ptr,
hMem);
RtlSetUserFlagsHeap(hProcessHeap,
HEAP_NO_SERIALIZE,
Ptr,
Flags);
}
}
else
@ -375,6 +380,19 @@ LocalReAlloc(HLOCAL hMem,
/* 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 */