Author: jimtabor
Date: Mon Jun 12 22:42:45 2017
New Revision: 75016
URL:
http://svn.reactos.org/svn/reactos?rev=75016&view=rev
Log:
[GDI32|Metafile]
- Instead of debug breaking, use wine code anyway. Should fix CORE-12911.
Modified:
trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c
Modified: trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/wine/ros…
==============================================================================
--- trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/wine/rosglue.c [iso-8859-1] Mon Jun 12 22:42:45 2017
@@ -402,13 +402,33 @@
ASSERT(hdcLink == hdc);
}
+/***********************************************************************
+ * bitmap_info_size
+ *
+ * Return the size of the bitmap info structure including color table.
+ */
int
bitmap_info_size(
const BITMAPINFO * info,
WORD coloruse)
{
- __debugbreak();
- return 0;
+ unsigned int colors, size, masks = 0;
+
+ if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
+ {
+ const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
+ colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
+ return sizeof(BITMAPCOREHEADER) + colors *
+ ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
+ }
+ else /* assume BITMAPINFOHEADER */
+ {
+ if (info->bmiHeader.biClrUsed) colors = min( info->bmiHeader.biClrUsed, 256
);
+ else colors = info->bmiHeader.biBitCount > 8 ? 0 : 1 <<
info->bmiHeader.biBitCount;
+ if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
+ size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks *
sizeof(DWORD) );
+ return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) :
sizeof(WORD));
+ }
}
BOOL