Index: trunk/src/gdi32/blit.cpp
===================================================================
--- trunk/src/gdi32/blit.cpp	(revision 3588)
+++ trunk/src/gdi32/blit.cpp	(revision 3589)
@@ -1,3 +1,3 @@
-/* $Id: blit.cpp,v 1.11 2000-05-12 19:14:55 sandervl Exp $ */
+/* $Id: blit.cpp,v 1.12 2000-05-22 19:11:27 sandervl Exp $ */
 
 /*
@@ -220,4 +220,74 @@
 //******************************************************************************
 //******************************************************************************
+INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
+                           INT heightDst, INT xSrc, INT ySrc, INT widthSrc,
+                           INT heightSrc, const void *bits,
+                           const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
+{
+#if 1
+ INT rc;
+
+    dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop));
+
+    if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
+    {
+      	// workaround for open32 bug.
+      	// If syscolors > 256 and wUsage == DIB_PAL_COLORS.
+
+      	int i;
+      	USHORT *pColorIndex = (USHORT *)info->bmiColors;
+      	RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed *
+                         sizeof(RGBQUAD));
+      	BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) +
+                             info->bmiHeader.biClrUsed * sizeof(RGBQUAD));
+
+      	memcpy(infoLoc, info, sizeof(BITMAPINFO));
+
+      	if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0)
+        	return FALSE;
+
+      	for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++)
+      	{
+         	infoLoc->bmiColors[i] = pColors[*pColorIndex];
+      	}
+
+      	rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
+                               widthSrc, heightSrc, (void *)bits,
+                               (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop);
+
+      	if(rc != heightDst) {
+		dprintf(("StretchDIBits failed with rc %x", rc));
+      	}
+	else {
+  		DIBSection *destdib = DIBSection::findHDC(hdc);
+  		if(destdib) {
+			destdib->sync(hdc, yDst, heightDst);
+  		}
+	}
+
+	return rc;
+    }
+
+    rc = O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
+                             widthSrc, heightSrc, (void *)bits,
+                             (PBITMAPINFO)info, wUsage, dwRop);
+    if(rc != heightDst) {
+	dprintf(("StretchDIBits failed with rc %x", rc));
+    }
+    else {
+  	DIBSection *destdib = DIBSection::findHDC(hdc);
+  	if(destdib) {
+		destdib->sync(hdc, yDst, heightDst);
+  	}
+    }
+
+    return rc;
+#else
+    dprintf(("GDI32: StretchDIBits\n"));
+    return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13);
+#endif
+}
+//******************************************************************************
+//******************************************************************************
 int WIN32API SetStretchBltMode( HDC arg1, int  arg2)
 {
Index: trunk/src/gdi32/gdi32.cpp
===================================================================
--- trunk/src/gdi32/gdi32.cpp	(revision 3588)
+++ trunk/src/gdi32/gdi32.cpp	(revision 3589)
@@ -1,3 +1,3 @@
-/* $Id: gdi32.cpp,v 1.46 2000-03-28 15:25:47 cbratschi Exp $ */
+/* $Id: gdi32.cpp,v 1.47 2000-05-22 19:11:28 sandervl Exp $ */
 
 /*
@@ -188,49 +188,4 @@
     dprintf(("CreateCompatibleDC %X returned %x", hdc, newHdc));
     return newHdc;
-}
-//******************************************************************************
-//******************************************************************************
-INT WIN32API StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
-                           INT heightDst, INT xSrc, INT ySrc, INT widthSrc,
-                           INT heightSrc, const void *bits,
-                           const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
-{
-#if 1
-    dprintf(("GDI32: StretchDIBits %x to (%d,%d) (%d,%d) from (%d,%d) (%d,%d), %x %x %x %x", hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop));
-
-    if(wUsage == DIB_PAL_COLORS && info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
-    {
-      // workaround for open32 bug.
-      // If syscolors > 256 and wUsage == DIB_PAL_COLORS.
-
-      int i;
-      USHORT *pColorIndex = (USHORT *)info->bmiColors;
-      RGBQUAD *pColors = (RGBQUAD *) alloca(info->bmiHeader.biClrUsed *
-                         sizeof(RGBQUAD));
-      BITMAPINFO *infoLoc = (BITMAPINFO *) alloca(sizeof(BITMAPINFO) +
-                             info->bmiHeader.biClrUsed * sizeof(RGBQUAD));
-
-      memcpy(infoLoc, info, sizeof(BITMAPINFO));
-
-      if(GetDIBColorTable(hdc, 0, info->bmiHeader.biClrUsed, pColors) == 0)
-        return FALSE;
-
-      for(i=0;i<info->bmiHeader.biClrUsed;i++, pColorIndex++)
-      {
-         infoLoc->bmiColors[i] = pColors[*pColorIndex];
-      }
-
-      return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
-                               widthSrc, heightSrc, (void *)bits,
-                               (PBITMAPINFO)infoLoc, DIB_RGB_COLORS, dwRop);
-    }
-
-    return O32_StretchDIBits(hdc, xDst, yDst, widthDst, heightDst, xSrc, ySrc,
-                             widthSrc, heightSrc, (void *)bits,
-                             (PBITMAPINFO)info, wUsage, dwRop);
-#else
-    dprintf(("GDI32: StretchDIBits\n"));
-    return O32_StretchDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, (void *)arg10, (PBITMAPINFO)arg11, arg12, arg13);
-#endif
 }
 //******************************************************************************
Index: trunk/src/gdi32/palette.cpp
===================================================================
--- trunk/src/gdi32/palette.cpp	(revision 3588)
+++ trunk/src/gdi32/palette.cpp	(revision 3589)
@@ -1,3 +1,3 @@
-/* $Id: palette.cpp,v 1.3 2000-02-16 14:18:12 sandervl Exp $ */
+/* $Id: palette.cpp,v 1.4 2000-05-22 19:11:28 sandervl Exp $ */
 
 /*
@@ -62,11 +62,11 @@
 {
   HPALETTE rc;
-    dprintf(("GDI32: CreatePalette\n"));
+
    for(int i=0; i<arg1->palNumEntries;i++)
    {
-     dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));
+     	dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));
    }
    rc = O32_CreatePalette(arg1);
-   dprintf(("  returns 0x%08X\n",rc));
+   dprintf(("GDI32: CreatePalette returns 0x%08X\n",rc));
 
    return rc;
@@ -114,8 +114,8 @@
 //******************************************************************************
 //******************************************************************************
-UINT WIN32API GetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PPALETTEENTRY  arg4)
+UINT WIN32API GetPaletteEntries( HPALETTE hPalette, UINT arg2, UINT arg3, PPALETTEENTRY  arg4)
 {
-    dprintf(("GDI32: GetPaletteEntries"));
-    return O32_GetPaletteEntries(arg1, arg2, arg3, arg4);
+    dprintf(("GDI32: GetPaletteEntries %x %d-%d %x", hPalette, arg2, arg3, arg4));
+    return O32_GetPaletteEntries(hPalette, arg2, arg3, arg4);
 }
 //******************************************************************************
@@ -139,8 +139,8 @@
 //******************************************************************************
 //******************************************************************************
-UINT WIN32API SetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PALETTEENTRY * arg4)
+UINT WIN32API SetPaletteEntries( HPALETTE hPalette, UINT arg2, UINT arg3, PALETTEENTRY * arg4)
 {
-    dprintf(("GDI32: SetPaletteEntries"));
-    return O32_SetPaletteEntries(arg1, arg2, arg3, (const PALETTEENTRY *)arg4);
+    dprintf(("GDI32: SetPaletteEntries %x %d-%d %x", hPalette, arg2, arg3, arg4));
+    return O32_SetPaletteEntries(hPalette, arg2, arg3, (const PALETTEENTRY *)arg4);
 }
 //******************************************************************************
