GetDIBits: Initialize more structure members

Michael Kaufmann hallo at michael-kaufmann.ch
Fri Jun 17 04:36:29 CDT 2005


Changelog:
  - Initialize more structure members, including biSizeImage if bits == 
NULL and biBitCount != 0

Thanks to Michael Ost from Muse Research who has found this missing feature.

-------------- next part --------------
Index: dlls/gdi/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/dib.c,v
retrieving revision 1.10
diff -u -r1.10 dib.c
--- dlls/gdi/dib.c	13 Apr 2005 14:45:27 -0000	1.10
+++ dlls/gdi/dib.c	17 Jun 2005 09:20:59 -0000
@@ -961,8 +961,28 @@
                                                        bmp->bitmap.bmHeight,
                                                        bmp->bitmap.bmBitsPixel );
                 info->bmiHeader.biCompression = 0;
+                info->bmiHeader.biXPelsPerMeter = 0;
+                info->bmiHeader.biYPelsPerMeter = 0;
+                info->bmiHeader.biClrUsed = 0;
+                info->bmiHeader.biClrImportant = 0;
+                
+                /* Windows 2000 doesn't touch the additional struct members if
+                   it's a BITMAPV4HEADER or a BITMAPV5HEADER */
             }
             lines = abs(bmp->bitmap.bmHeight);
+        }
+        else
+        {
+            /* The knowledge base article Q81498 ("DIBs and Their Uses") states that
+               if bits == NULL and bpp != 0, only biSizeImage and the color table are
+               filled in. */
+            if (!core_header)
+            {
+                /* FIXME: biSizeImage should be calculated according to the selected
+                          compression algorithm if biCompression != BI_RGB */
+                info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( width, height, bpp );
+            }
+            lines = abs(height);
         }
     }
 


More information about the wine-patches mailing list