mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 14:16:05 +00:00
Changed many WARN()s related to internal Wine memory failures to
ERR()s.
This commit is contained in:
parent
6569ba3f09
commit
6f36e642b0
|
@ -189,7 +189,7 @@ static HEAP *HEAP_GetPtr(
|
|||
HEAP *heapPtr = (HEAP *)heap;
|
||||
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
|
||||
{
|
||||
WARN(heap, "Invalid heap %08x!\n", heap );
|
||||
ERR(heap, "Invalid heap %08x!\n", heap );
|
||||
SetLastError( ERROR_INVALID_HANDLE );
|
||||
return NULL;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ static BOOL32 HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
|
|||
(flags & HEAP_WINE_CODESEG) != 0, FALSE );
|
||||
if (!selector)
|
||||
{
|
||||
WARN(heap, "Could not allocate selector\n" );
|
||||
ERR(heap, "Could not allocate selector\n" );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -646,7 +646,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
/* Check magic number */
|
||||
if (pArena->magic != ARENA_FREE_MAGIC)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: invalid free arena magic for %08lx\n",
|
||||
ERR(heap, "Heap %08lx: invalid free arena magic for %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -654,20 +654,20 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
if (!(pArena->size & ARENA_FLAG_FREE) ||
|
||||
(pArena->size & ARENA_FLAG_PREV_FREE))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad flags %lx for free arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad flags %lx for free arena %08lx\n",
|
||||
(DWORD)subheap->heap, pArena->size & ~ARENA_SIZE_MASK, (DWORD)pArena );
|
||||
}
|
||||
/* Check arena size */
|
||||
if ((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) > heapEnd)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad size %08lx for free arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad size %08lx for free arena %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->size & ARENA_SIZE_MASK, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
/* Check that next pointer is valid */
|
||||
if (!HEAP_IsValidArenaPtr( subheap->heap, pArena->next ))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad next ptr %08lx for arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad next ptr %08lx for arena %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->next, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -675,14 +675,14 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
if (!(pArena->next->size & ARENA_FLAG_FREE) ||
|
||||
(pArena->next->magic != ARENA_FREE_MAGIC))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: next arena %08lx invalid for %08lx\n",
|
||||
ERR(heap, "Heap %08lx: next arena %08lx invalid for %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->next, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
/* Check that prev pointer is valid */
|
||||
if (!HEAP_IsValidArenaPtr( subheap->heap, pArena->prev ))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad prev ptr %08lx for arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad prev ptr %08lx for arena %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->prev, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -690,7 +690,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
if (!(pArena->prev->size & ARENA_FLAG_FREE) ||
|
||||
(pArena->prev->magic != ARENA_FREE_MAGIC))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: prev arena %08lx invalid for %08lx\n",
|
||||
ERR(heap, "Heap %08lx: prev arena %08lx invalid for %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->prev, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -700,7 +700,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
if (!(*(DWORD *)((char *)(pArena + 1) +
|
||||
(pArena->size & ARENA_SIZE_MASK)) & ARENA_FLAG_PREV_FREE))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: free arena %08lx next block has no PREV_FREE flag\n",
|
||||
ERR(heap, "Heap %08lx: free arena %08lx next block has no PREV_FREE flag\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
|
|||
if (*((ARENA_FREE **)((char *)(pArena + 1) +
|
||||
(pArena->size & ARENA_SIZE_MASK)) - 1) != pArena)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: arena %08lx has wrong back ptr %08lx\n",
|
||||
ERR(heap, "Heap %08lx: arena %08lx has wrong back ptr %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena,
|
||||
*((DWORD *)((char *)(pArena+1)+ (pArena->size & ARENA_SIZE_MASK)) - 1));
|
||||
return FALSE;
|
||||
|
@ -728,20 +728,20 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
|
|||
/* Check magic number */
|
||||
if (pArena->magic != ARENA_INUSE_MAGIC)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: invalid in-use arena magic for %08lx\n",
|
||||
ERR(heap, "Heap %08lx: invalid in-use arena magic for %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
/* Check size flags */
|
||||
if (pArena->size & ARENA_FLAG_FREE)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad flags %lx for in-use arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad flags %lx for in-use arena %08lx\n",
|
||||
(DWORD)subheap->heap, pArena->size & ~ARENA_SIZE_MASK, (DWORD)pArena );
|
||||
}
|
||||
/* Check arena size */
|
||||
if ((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) > heapEnd)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad size %08lx for in-use arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad size %08lx for in-use arena %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena->size & ARENA_SIZE_MASK, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
|
|||
if (((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) < heapEnd) &&
|
||||
(*(DWORD *)((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK)) & ARENA_FLAG_PREV_FREE))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: in-use arena %08lx next block has PREV_FREE flag\n",
|
||||
ERR(heap, "Heap %08lx: in-use arena %08lx next block has PREV_FREE flag\n",
|
||||
(DWORD)subheap->heap, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
|
|||
/* Check prev pointer */
|
||||
if (!HEAP_IsValidArenaPtr( subheap->heap, pPrev ))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: bad back ptr %08lx for arena %08lx\n",
|
||||
ERR(heap, "Heap %08lx: bad back ptr %08lx for arena %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -768,14 +768,14 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
|
|||
if (!(pPrev->size & ARENA_FLAG_FREE) ||
|
||||
(pPrev->magic != ARENA_FREE_MAGIC))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: prev arena %08lx invalid for in-use %08lx\n",
|
||||
ERR(heap, "Heap %08lx: prev arena %08lx invalid for in-use %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
/* Check that prev arena is really the previous block */
|
||||
if ((char *)(pPrev + 1) + (pPrev->size & ARENA_SIZE_MASK) != (char *)pArena)
|
||||
{
|
||||
WARN(heap, "Heap %08lx: prev arena %08lx is not prev for in-use %08lx\n",
|
||||
ERR(heap, "Heap %08lx: prev arena %08lx is not prev for in-use %08lx\n",
|
||||
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -835,7 +835,7 @@ SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr )
|
|||
flags |= heapPtr->flags;
|
||||
if (!(flags & HEAP_WINE_SEGPTR))
|
||||
{
|
||||
WARN(heap, "Heap %08x is not a SEGPTR heap\n",
|
||||
ERR(heap, "Heap %08x is not a SEGPTR heap\n",
|
||||
heap );
|
||||
return 0;
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr )
|
|||
|
||||
if (!(subheap = HEAP_FindSubHeap( heapPtr, ptr )))
|
||||
{
|
||||
WARN(heap, "%p is not inside heap %08x\n",
|
||||
ERR(heap, "%p is not inside heap %08x\n",
|
||||
ptr, heap );
|
||||
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
|
||||
return 0;
|
||||
|
@ -1256,7 +1256,7 @@ BOOL32 WINAPI HeapValidate(
|
|||
|
||||
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
|
||||
{
|
||||
WARN(heap, "Invalid heap %08x!\n", heap );
|
||||
ERR(heap, "Invalid heap %08x!\n", heap );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ BOOL32 WINAPI HeapValidate(
|
|||
((char *)block < (char *)subheap + subheap->headerSize
|
||||
+ sizeof(ARENA_INUSE)))
|
||||
{
|
||||
WARN(heap, "Heap %08lx: block %08lx is not inside heap\n",
|
||||
ERR(heap, "Heap %08lx: block %08lx is not inside heap\n",
|
||||
(DWORD)heap, (DWORD)block );
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -334,7 +334,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
|
|||
/* cleared before use, so we can test for double initialization. */
|
||||
if (LOCAL_GetHeap(selector))
|
||||
{
|
||||
WARN(local, "Heap %04x initialized twice.\n", selector);
|
||||
ERR(local, "Heap %04x initialized twice.\n", selector);
|
||||
LOCAL_PrintHeap(selector);
|
||||
}
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ static void LOCAL_GrowHeap( HANDLE16 ds )
|
|||
ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
|
||||
pHeapInfo = LOCAL_GetHeap( ds );
|
||||
if (pHeapInfo == NULL) {
|
||||
WARN(local, "Heap not found\n" );
|
||||
ERR(local, "Heap not found\n" );
|
||||
return;
|
||||
}
|
||||
end = GlobalSize16( hseg );
|
||||
|
@ -497,7 +497,7 @@ static HLOCAL16 LOCAL_FreeArena( WORD ds, WORD arena )
|
|||
if ((pArena->prev & 3) == LOCAL_ARENA_FREE)
|
||||
{
|
||||
/* shouldn't happen */
|
||||
WARN(local, "Trying to free block %04x twice!\n",
|
||||
ERR(local, "Trying to free block %04x twice!\n",
|
||||
arena );
|
||||
LOCAL_PrintHeap( ds );
|
||||
return arena;
|
||||
|
@ -620,7 +620,7 @@ static WORD LOCAL_GetFreeSpace(WORD ds, WORD countdiscard)
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n" );
|
||||
ERR(local, "Local heap not found\n" );
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n" );
|
||||
ERR(local, "Local heap not found\n" );
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ static HLOCAL16 LOCAL_FindFreeBlock( HANDLE16 ds, WORD size )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n" );
|
||||
ERR(local, "Local heap not found\n" );
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -787,7 +787,7 @@ static HLOCAL16 LOCAL_FindFreeBlock( HANDLE16 ds, WORD size )
|
|||
if (arena == pArena->free_next) break;
|
||||
if (pArena->size >= size) return arena;
|
||||
}
|
||||
WARN(local, "not enough space\n" );
|
||||
ERR(local, "not enough space\n" );
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -806,7 +806,7 @@ static HLOCAL16 LOCAL_GetBlock( HANDLE16 ds, WORD size, WORD flags )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n");
|
||||
ERR(local, "Local heap not found\n");
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -869,7 +869,7 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds )
|
|||
TRACE(local, "Local_NewHTable\n" );
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n");
|
||||
ERR(local, "Local heap not found\n");
|
||||
LOCAL_PrintHeap(ds);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -878,9 +878,9 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds )
|
|||
+ 2 * sizeof(WORD), LMEM_FIXED )))
|
||||
return FALSE;
|
||||
if (!(ptr = PTR_SEG_OFF_TO_LIN( ds, 0 )))
|
||||
WARN(local, "ptr == NULL after GetBlock.\n");
|
||||
ERR(local, "ptr == NULL after GetBlock.\n");
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
WARN(local,"pInfo == NULL after GetBlock.\n");
|
||||
ERR(local,"pInfo == NULL after GetBlock.\n");
|
||||
|
||||
/* Fill the entry table */
|
||||
|
||||
|
@ -908,7 +908,7 @@ static HLOCAL16 LOCAL_GetNewHandleEntry( HANDLE16 ds )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "Local heap not found\n");
|
||||
ERR(local, "Local heap not found\n");
|
||||
LOCAL_PrintHeap(ds);
|
||||
return 0;
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ static void LOCAL_FreeHandleEntry( HANDLE16 ds, HLOCAL16 handle )
|
|||
}
|
||||
if (!*pTable)
|
||||
{
|
||||
WARN(local, "Invalid entry %04x\n", handle);
|
||||
ERR(local, "Invalid entry %04x\n", handle);
|
||||
LOCAL_PrintHeap( ds );
|
||||
return;
|
||||
}
|
||||
|
@ -1136,12 +1136,12 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
|
|||
}
|
||||
if (((blockhandle = pEntry->addr) & 3) != 2)
|
||||
{
|
||||
WARN(local, "(%04x,%04x): invalid handle\n",
|
||||
ERR(local, "(%04x,%04x): invalid handle\n",
|
||||
ds, handle );
|
||||
return 0;
|
||||
}
|
||||
if(*((HLOCAL16 *)(ptr + blockhandle) - 1) != handle) {
|
||||
WARN(local, "Back ptr to handle is invalid\n");
|
||||
ERR(local, "Back ptr to handle is invalid\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1230,14 +1230,14 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
|
|||
{
|
||||
if (HANDLE_FIXED(handle))
|
||||
{
|
||||
WARN(local, "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
|
||||
ERR(local, "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(((LOCALHANDLEENTRY *)(ptr + handle))->lock != 0)
|
||||
{
|
||||
WARN(local, "Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
|
||||
ERR(local, "Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1261,7 +1261,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
|
|||
{
|
||||
if (!(hmem = LOCAL_GetBlock( ds, oldsize, flags )))
|
||||
{
|
||||
WARN(local, "Can't restore saved block\n" );
|
||||
ERR(local, "Can't restore saved block\n" );
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
return 0;
|
||||
}
|
||||
|
@ -1283,7 +1283,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
|
|||
pEntry->addr = hmem + sizeof(HLOCAL16);
|
||||
/* Back ptr should still be correct */
|
||||
if(*(HLOCAL16 *)(ptr + hmem) != handle)
|
||||
WARN(local, "back ptr is invalid.\n");
|
||||
ERR(local, "back ptr is invalid.\n");
|
||||
hmem = handle;
|
||||
}
|
||||
if (size == oldsize) hmem = 0; /* Realloc failed */
|
||||
|
@ -1423,7 +1423,7 @@ WORD LOCAL_CountFree( HANDLE16 ds )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "(%04x): Local heap not found\n", ds );
|
||||
ERR(local, "(%04x): Local heap not found\n", ds );
|
||||
LOCAL_PrintHeap( ds );
|
||||
return 0;
|
||||
}
|
||||
|
@ -1456,7 +1456,7 @@ HLOCAL16 LOCAL_Handle( HANDLE16 ds, WORD addr )
|
|||
|
||||
if (!(pInfo = LOCAL_GetHeap( ds )))
|
||||
{
|
||||
WARN(local, "(%04x): Local heap not found\n", ds );
|
||||
ERR(local, "(%04x): Local heap not found\n", ds );
|
||||
LOCAL_PrintHeap( ds );
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue