- Fix a typo in a comparison (& vs &&) which was breaking GlobalReAlloc in some cases.

- Fix a missing | (OR) in GlobalAlloc which created an invalid handle if the first allocation was of size 0.

svn path=/trunk/; revision=22646
This commit is contained in:
Alex Ionescu
2006-06-26 22:48:12 +00:00
parent 2eddc82aca
commit 2410073dc4
2 changed files with 3 additions and 2 deletions
@@ -65,6 +65,7 @@ extern RTL_HANDLE_TABLE BaseHeapHandleTable;
#define BASE_TRACE_FAILURE() \
BH_PRINT("[BASE_HEAP] %s : Failing %d\n", \
__FUNCTION__, __LINE__)
//
// The handle structure for global heap handles.
// Notice that it nicely overlays with RTL_HANDLE_ENTRY.
+2 -2
View File
@@ -117,7 +117,7 @@ Quickie:
if (!Ptr)
{
/* We don't have a valid pointer, but so reuse this handle */
HandleEntry->Flags = BASE_HEAP_ENTRY_FLAG_REUSE;
HandleEntry->Flags |= BASE_HEAP_ENTRY_FLAG_REUSE;
}
/* Check if the handle is discardable */
@@ -486,7 +486,7 @@ GlobalReAlloc(HGLOBAL hMem,
if (Ptr)
{
/* Make sure the handle isn't locked */
if ((uFlags & GMEM_MOVEABLE) & !(HandleEntry->LockCount))
if ((uFlags & GMEM_MOVEABLE) && !(HandleEntry->LockCount))
{
/* Free the current heap */
RtlFreeHeap(hProcessHeap, Flags, Ptr);