#include <stdlib.h>
#include <win32k/bitmaps.h>
#include <win32k/debug.h>
-#include <debug.h>
#include "../eng/handle.h"
#include <ntos/minmax.h>
+#include <include/inteng.h>
-VOID BitmapToSurf(HDC hdc, PSURFGDI SurfGDI, PSURFOBJ SurfObj, PBITMAPOBJ Bitmap);
+#define NDEBUG
+#include <win32k/debug1.h>
UINT STDCALL W32kSetDIBColorTable(HDC hDC,
UINT StartIndex,
lpRGB = &bmi->bmiColors[0];
// Create a temporary surface for the destination bitmap
- DestBitmap = (HBITMAP)CreateGDIHandle(sizeof(SURFGDI), sizeof(SURFOBJ));
+ DestBitmap = BitmapToSurf(bitmap);
DestSurf = (PSURFOBJ) AccessUserObject( DestBitmap );
DestGDI = (PSURFGDI) AccessInternalObject( DestBitmap );
- BitmapToSurf(hDC, DestGDI, DestSurf, bitmap);
-
// Create source surface
SourceSize.cx = bmi->bmiHeader.biWidth;
SourceSize.cy = abs(bmi->bmiHeader.biHeight);
DIB_Palette = BuildDIBPalette(bmi, &DIB_Palette_Type);
// Determine XLATEOBJ for color translation
- XlateObj = EngCreateXlate(DDB_Palette_Type, DIB_Palette_Type, DDB_Palette, DIB_Palette);
+ XlateObj = IntEngCreateXlate(DDB_Palette_Type, DIB_Palette_Type, DDB_Palette, DIB_Palette);
// Zero point
ZeroPoint.x = 0;
}
// Clean up
+ EngDeleteXlate(XlateObj);
+ EngDeletePalette(DIB_Palette);
EngDeleteSurface(SourceBitmap);
EngDeleteSurface(DestBitmap);
}
else
{
- DbgPrint("(%ld): wrong size for data\n", data->bmiHeader.biSize );
+ DPRINT("(%ld): wrong size for data\n", data->bmiHeader.biSize );
return 0;
}
}
UINT Entries = 0;
BITMAP bm;
- DbgPrint("format (%ld,%ld), planes %d, bpp %d, size %ld, colors %ld (%s)\n",
+ DPRINT("format (%ld,%ld), planes %d, bpp %d, size %ld, colors %ld (%s)\n",
bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount,
bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB");
if (section)
/* bm.bmBits = MapViewOfFile(section, FILE_MAP_ALL_ACCESS,
0L, offset, totalSize); */
- DbgPrint("DIB_CreateDIBSection: Cannot yet handle section DIBs\n");
+ DPRINT("DIB_CreateDIBSection: Cannot yet handle section DIBs\n");
else if (ovr_pitch && offset)
bm.bmBits = (LPVOID) offset;
else {
// Clean up in case of errors
if (!res || !bmp || !dib || !bm.bmBits)
{
- DbgPrint("got an error res=%08x, bmp=%p, dib=%p, bm.bmBits=%p\n", res, bmp, dib, bm.bmBits);
+ DPRINT("got an error res=%08x, bmp=%p, dib=%p, bm.bmBits=%p\n", res, bmp, dib, bm.bmBits);
/* if (bm.bmBits)
{
if (section)
*compr = 0;
return 0;
}
- DbgPrint("(%ld): wrong size for header\n", header->biSize );
+ DPRINT("(%ld): wrong size for header\n", header->biSize );
return -1;
}