Revert r20367 and r20368 since they crash the GUI in second boot by hitting a assert...
[reactos.git] / reactos / subsys / win32k / objects / bitmaps.c
index a9f2718..1733f48 100644 (file)
@@ -41,9 +41,7 @@ NtGdiBitBlt(
        HDC  hDCSrc,
        INT  XSrc,
        INT  YSrc,
-       DWORD  ROP,
-       IN DWORD crBackColor,
-       IN FLONG fl)
+       DWORD  ROP)
 {
        PDC DCDest = NULL;
        PDC DCSrc  = NULL;
@@ -459,7 +457,7 @@ NtGdiCreateBitmap(
        INT  Height,
        UINT  Planes,
        UINT  BitsPixel,
-       IN OPTIONAL LPBYTE Bits)
+       CONST VOID *Bits)
 {
    BITMAP BM;
 
@@ -469,7 +467,7 @@ NtGdiCreateBitmap(
    BM.bmWidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel);
    BM.bmPlanes = Planes;
    BM.bmBitsPixel = BitsPixel;
-   BM.bmBits = Bits;
+   BM.bmBits = (LPVOID) Bits;
 
    return IntCreateBitmapIndirect(&BM);
 }
@@ -714,7 +712,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
                                {
                                        PBITMAPOBJ bmpobj;
 
-                                       NtGdiBitBlt ( hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY, 0, 0 );
+                                       NtGdiBitBlt ( hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY );
                                        NtGdiSelectObject ( hDCTmp, hBmpOld );
 
                                        // our bitmap is no longer selected, so we can access it's stuff...
@@ -758,8 +756,7 @@ NtGdiMaskBlt (
        HDC hdcDest, INT nXDest, INT nYDest,
        INT nWidth, INT nHeight, HDC hdcSrc,
        INT nXSrc, INT nYSrc, HBITMAP hbmMask,
-       INT xMask, INT yMask, DWORD dwRop,
-       IN DWORD crBackColor)
+       INT xMask, INT yMask, DWORD dwRop)
 {
        HBITMAP hOldMaskBitmap, hBitmap2, hOldBitmap2, hBitmap3, hOldBitmap3;
        HDC hDCMask, hDC1, hDC2;
@@ -896,7 +893,7 @@ NtGdiMaskBlt (
        };
 
        if (!hbmMask)
-               return NtGdiBitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, FRGND_ROP3(dwRop), 0, 0);
+               return NtGdiBitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, FRGND_ROP3(dwRop));
 
        /* 1. make mask bitmap's dc */
        hDCMask = NtGdiCreateCompatibleDC(hdcDest);
@@ -910,9 +907,9 @@ NtGdiMaskBlt (
        hOldBitmap2 = (HBITMAP)NtGdiSelectObject(hDC1, hBitmap2);
 
        /* 2.2 draw dest bitmap and mask */
-       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, SRCCOPY, 0, 0);
-       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, BKGND_ROP3(dwRop), 0, 0);
-       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hDCMask, xMask, yMask, DSTERASE, 0, 0);
+       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, SRCCOPY);
+       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, BKGND_ROP3(dwRop));
+       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hDCMask, xMask, yMask, DSTERASE);
 
        /* 3. make masked Foreground bitmap */
 
@@ -922,13 +919,13 @@ NtGdiMaskBlt (
        hOldBitmap3 = (HBITMAP)NtGdiSelectObject(hDC2, hBitmap3);
 
        /* 3.2 draw src bitmap and mask */
-       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY, 0, 0);
-       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, FRGND_ROP3(dwRop), 0,0);
-       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hDCMask, xMask, yMask, SRCAND, 0, 0);
+       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY);
+       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, FRGND_ROP3(dwRop));
+       NtGdiBitBlt(hDC2, 0, 0, nWidth, nHeight, hDCMask, xMask, yMask, SRCAND);
 
        /* 4. combine two bitmap and copy it to hdcDest */
-       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hDC2, 0, 0, SRCPAINT, 0, 0);
-       NtGdiBitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hDC1, 0, 0, SRCCOPY, 0, 0);
+       NtGdiBitBlt(hDC1, 0, 0, nWidth, nHeight, hDC2, 0, 0, SRCPAINT);
+       NtGdiBitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hDC1, 0, 0, SRCCOPY);
 
        /* 5. restore all object */
        NtGdiSelectObject(hDCMask, hOldMaskBitmap);
@@ -946,20 +943,18 @@ NtGdiMaskBlt (
        return TRUE;
 }
 
-BOOL
-APIENTRY
+BOOL STDCALL
 NtGdiPlgBlt(
-    IN HDC hdcTrg,
-    IN LPPOINT pptlTrg,
-    IN HDC hdcSrc,
-    IN INT xSrc,
-    IN INT ySrc,
-    IN INT cxSrc,
-    IN INT cySrc,
-    IN HBITMAP hbmMask,
-    IN INT xMask,
-    IN INT yMask,
-    IN DWORD crBackColor)
+       HDC  hDCDest,
+       CONST POINT  *Point,
+       HDC  hDCSrc,
+       INT  XSrc,
+       INT  YSrc,
+       INT  Width,
+       INT  Height,
+       HBITMAP  hMaskBitmap,
+       INT  xMask,
+       INT  yMask)
 {
        UNIMPLEMENTED;
        return FALSE;
@@ -969,7 +964,7 @@ LONG STDCALL
 NtGdiSetBitmapBits(
        HBITMAP  hBitmap,
        DWORD  Bytes,
-       IN PBYTE Bits)
+       CONST VOID *Bits)
 {
        LONG height, ret;
        PBITMAPOBJ bmp;
@@ -1077,7 +1072,7 @@ NtGdiSetPixelV(
        INT  Y,
        COLORREF  Color)
 {
-       HBRUSH NewBrush = NtGdiCreateSolidBrush(Color, NULL);
+       HBRUSH NewBrush = NtGdiCreateSolidBrush(Color);
        HGDIOBJ OldBrush;
 
        if (NewBrush == NULL)
@@ -1106,8 +1101,7 @@ NtGdiStretchBlt(
        INT  YOriginSrc,
        INT  WidthSrc,
        INT  HeightSrc,
-       DWORD  ROP,
-       IN DWORD dwBackColor)
+       DWORD  ROP)
 {
        PDC DCDest = NULL;
        PDC DCSrc  = NULL;
@@ -1329,17 +1323,16 @@ failed:
 BOOL STDCALL
 NtGdiAlphaBlend(
        HDC  hDCDest,
-       LONG  XOriginDest,
-       LONG  YOriginDest,
-       LONG  WidthDest,
-       LONG  HeightDest,
+       INT  XOriginDest,
+       INT  YOriginDest,
+       INT  WidthDest,
+       INT  HeightDest,
        HDC  hDCSrc,
-       LONG  XOriginSrc,
-       LONG  YOriginSrc,
-       LONG  WidthSrc,
-       LONG  HeightSrc,
-       BLENDFUNCTION  BlendFunc,
-       IN HANDLE hcmXform)
+       INT  XOriginSrc,
+       INT  YOriginSrc,
+       INT  WidthSrc,
+       INT  HeightSrc,
+       BLENDFUNCTION  BlendFunc)
 {
        PDC DCDest = NULL;
        PDC DCSrc  = NULL;