mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
- 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:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user