- Use hack to prevent Explorer crash.

svn path=/trunk/; revision=26554
This commit is contained in:
Dmitry Gorbachev 2007-04-28 04:10:33 +00:00
parent 4b61211e6d
commit d36cd41e29

View file

@ -398,18 +398,18 @@ NtGdiGetDIBits(HDC hDC,
if (Bits == NULL) if (Bits == NULL)
{ {
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{ {
BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info; BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info;
coreheader->bcWidth =BitmapObj->SurfObj.sizlBitmap.cx; coreheader->bcWidth =BitmapObj->SurfObj.sizlBitmap.cx;
coreheader->bcPlanes = 1; coreheader->bcPlanes = 1;
coreheader->bcBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat); coreheader->bcBitCount = BitsPerFormat(BitmapObj->SurfObj.iBitmapFormat);
coreheader->bcHeight = BitmapObj->SurfObj.sizlBitmap.cy; coreheader->bcHeight = BitmapObj->SurfObj.sizlBitmap.cy;
if (BitmapObj->SurfObj.lDelta > 0) if (BitmapObj->SurfObj.lDelta > 0)
coreheader->bcHeight = -coreheader->bcHeight; coreheader->bcHeight = -coreheader->bcHeight;
Result = BitmapObj->SurfObj.sizlBitmap.cy; Result = BitmapObj->SurfObj.sizlBitmap.cy;
} }
if (Info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) if (Info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
{ {
@ -462,27 +462,27 @@ NtGdiGetDIBits(HDC hDC,
DestSize.cx = BitmapObj->SurfObj.sizlBitmap.cx; DestSize.cx = BitmapObj->SurfObj.sizlBitmap.cx;
DestSize.cy = ScanLines; DestSize.cy = ScanLines;
DestBitmap = NULL; DestBitmap = NULL;
if (Info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER)) if (Info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
{ {
DestBitmap = EngCreateBitmap( DestSize, DestBitmap = EngCreateBitmap(DestSize,
DIB_GetDIBWidthBytes(DestSize.cx, Info->bmiHeader.biBitCount), /* DIB_GetDIBWidthBytes(DestSize.cx, Info->bmiHeader.biBitCount), */
BitmapFormat(Info->bmiHeader.biBitCount, Info->bmiHeader.biCompression), DestSize.cx * (Info->bmiHeader.biBitCount >> 3), /* HACK */
0 < Info->bmiHeader.biHeight ? 0 : BMF_TOPDOWN, BitmapFormat(Info->bmiHeader.biBitCount, Info->bmiHeader.biCompression),
Bits); 0 < Info->bmiHeader.biHeight ? 0 : BMF_TOPDOWN,
} Bits);
}
if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{ {
BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info; BITMAPCOREHEADER* coreheader = (BITMAPCOREHEADER*) Info;
DestBitmap = EngCreateBitmap( DestSize,
DIB_GetDIBWidthBytes(DestSize.cx, coreheader->bcBitCount),
BitmapFormat(coreheader->bcBitCount, BI_RGB),
0 < coreheader->bcHeight ? 0 : BMF_TOPDOWN,
Bits);
}
DestBitmap = EngCreateBitmap(DestSize,
DIB_GetDIBWidthBytes(DestSize.cx, coreheader->bcBitCount),
BitmapFormat(coreheader->bcBitCount, BI_RGB),
0 < coreheader->bcHeight ? 0 : BMF_TOPDOWN,
Bits);
}
if(DestBitmap == NULL) if(DestBitmap == NULL)
{ {