diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index 6b13392c9a3..0bae35a1058 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -682,10 +682,6 @@ VOID IntHandleSpecialColorType(HDC hDC, COLORREF* Color) { *Color = RGB(palEntry.peRed, palEntry.peGreen, palEntry.peBlue); } - else - { - DPRINT1("no wai!\n"); - } DC_UnlockDc(pdc); break; case 0x01: /* PALETTEINDEX */ diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index 6a5d4044527..00a5d4773d7 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -149,7 +149,7 @@ IntGetDIBColorTable( PDC dc; PSURFACE psurf; PPALETTE PalGDI; - UINT Index; + UINT Index, Count = 0; ULONG biBitCount; if (!(dc = DC_LockDc(hDC))) return 0; @@ -197,15 +197,14 @@ IntGetDIBColorTable( Colors[Index - StartIndex].rgbGreen = PalGDI->IndexedColors[Index].peGreen; Colors[Index - StartIndex].rgbBlue = PalGDI->IndexedColors[Index].peBlue; Colors[Index - StartIndex].rgbReserved = 0; + Count++; } PALETTE_UnlockPalette(PalGDI); } - else - Entries = 0; DC_UnlockDc(dc); - return Entries; + return Count; } // Converts a DIB to a device-dependent bitmap @@ -1509,17 +1508,14 @@ DIB_CreateDIBSection( table between the DIB and the X physical device. Obviously, this is left out of the ReactOS implementation. Instead, we call NtGdiSetDIBColorTable. */ - bi->biClrUsed = 0; - /* set number of entries in bmi.bmiColors table */ - if (bi->biBitCount == 1) { - bi->biClrUsed = 2; - } else - if (bi->biBitCount == 4) { - bi->biClrUsed = 16; - } else - if (bi->biBitCount == 8) { - bi->biClrUsed = 256; - } + if (bi->biBitCount <= 8) + { + bi->biClrUsed = 1 << bi->biBitCount; + } + else + { + bi->biClrUsed = 0; + } bmp->hDIBSection = section; bmp->hSecure = hSecure;