--- wine/dlls/gdi/gdiobj.c	2004-07-21 05:07:28.000000000 +0100
+++ wine-develop/dlls/gdi/gdiobj.c	2004-08-01 15:46:58.000000000 +0100
@@ -721,7 +721,8 @@
     obj->hdcs    = NULL;
 
     TRACE_SEC( *handle, "enter" );
-    return obj;
+printf("GDI allocate %d, %x returning %p\n", size, magic,  obj);
+return obj;
 
 error:
     _LeaveSysLevel( &GDI_level );
@@ -745,9 +746,11 @@
         HLOCAL16 h = LOWORD(handle);
         LOCAL_Unlock( GDI_HeapSel, h );
         if ((new_handle = (HGDIOBJ)(ULONG_PTR)LOCAL_ReAlloc( GDI_HeapSel, h, size, LMEM_MOVEABLE )))
-        {
+        {void *x;
             assert( new_handle == handle );  /* moveable handle cannot change */
-            return LOCAL_Lock( GDI_HeapSel, h );
+            x = LOCAL_Lock( GDI_HeapSel, h );
+	    printf("GDI reallocate %p, %x returning %p\n", handle, object, x);
+	    return x;
         }
     }
     else
@@ -759,6 +762,8 @@
             if (new_ptr)
             {
                 large_handles[i] = new_ptr;
+		printf("GDI reallocate %p, %x returning %p\n", handle, object, new_ptr);
+		
                 return new_ptr;
             }
         }
@@ -776,7 +781,7 @@
 BOOL GDI_FreeObject( HGDIOBJ handle, void *ptr )
 {
     GDIOBJHDR *object = ptr;
-
+printf("GDI free %p %p\n", handle, ptr);
     object->wMagic = 0;  /* Mark it as invalid */
     object->funcs  = NULL;
     if ((UINT_PTR)handle & 2)  /* GDI heap handle */
@@ -843,7 +848,7 @@
     {
         _LeaveSysLevel( &GDI_level );
         SetLastError( ERROR_INVALID_HANDLE );
-        WARN( "Invalid handle %p\n", handle );
+        WARN( "Invalid handle %p for magic %d\n", handle, magic );
     }
     else TRACE_SEC( handle, "enter" );
 
