- Rename bitblt.c to more generic bitmap.c.
- Normalize BITMAPINFO structure in CreateDIBSection before sending it to win32k.
Modified: trunk/reactos/lib/gdi32/gdi32.def
Modified: trunk/reactos/lib/gdi32/include/precomp.h
Modified: trunk/reactos/lib/gdi32/makefile
Deleted: trunk/reactos/lib/gdi32/objects/bitblt.c
Added: trunk/reactos/lib/gdi32/objects/bitmap.c
Modified: trunk/reactos/lib/gdi32/objects/utils.c

Modified: trunk/reactos/lib/gdi32/gdi32.def
--- trunk/reactos/lib/gdi32/gdi32.def	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/gdi32.def	2005-03-20 12:30:06 UTC (rev 14217)
@@ -58,7 +58,7 @@
 CreateDCW@16
 CreateDIBPatternBrush@8
 CreateDIBPatternBrushPt@8
-CreateDIBSection@24=NtGdiCreateDIBSection@24
+CreateDIBSection@24
 CreateDIBitmap@24=NtGdiCreateDIBitmap@24
 CreateDiscardableBitmap@12=NtGdiCreateDiscardableBitmap@12
 CreateEllipticRgn@16=NtGdiCreateEllipticRgn@16

Modified: trunk/reactos/lib/gdi32/include/precomp.h
--- trunk/reactos/lib/gdi32/include/precomp.h	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/include/precomp.h	2005-03-20 12:30:06 UTC (rev 14217)
@@ -59,7 +59,7 @@
 
 /* == BITMAP UTILITY FUNCTIONS ============================================== */
 
-BOOL STDCALL CalculateColorTableSize(LPBITMAPINFOHEADER BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize);
-LPBITMAPINFO STDCALL ConvertBitmapInfo(LPBITMAPINFO BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData);
+BOOL STDCALL CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize);
+LPBITMAPINFO STDCALL ConvertBitmapInfo(CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData);
 
 /* EOF */

Modified: trunk/reactos/lib/gdi32/makefile
--- trunk/reactos/lib/gdi32/makefile	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/makefile	2005-03-20 12:30:06 UTC (rev 14217)
@@ -39,7 +39,7 @@
  misc/win32k.o
 
 OBJECTS_OBJECTS = \
- objects/bitblt.o \
+ objects/bitmap.o \
  objects/utils.o \
  objects/brush.o \
  objects/dc.o \

Deleted: trunk/reactos/lib/gdi32/objects/bitblt.c
--- trunk/reactos/lib/gdi32/objects/bitblt.c	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/objects/bitblt.c	2005-03-20 12:30:06 UTC (rev 14217)
@@ -1,42 +0,0 @@
-/* $Id$
- *
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS system libraries
- * FILE:            lib/gdi32/object/bitblt.c
- * PURPOSE:         
- * PROGRAMMER:
- */
-
-#include "precomp.h"
-
-#include <debug.h>
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-StretchBlt(
-           HDC hdcDest,      // handle to destination DC
-           int nXOriginDest, // x-coord of destination upper-left corner
-           int nYOriginDest, // y-coord of destination upper-left corner
-           int nWidthDest,   // width of destination rectangle
-           int nHeightDest,  // height of destination rectangle
-           HDC hdcSrc,       // handle to source DC
-           int nXOriginSrc,  // x-coord of source upper-left corner
-           int nYOriginSrc,  // y-coord of source upper-left corner
-           int nWidthSrc,    // width of source rectangle
-           int nHeightSrc,   // height of source rectangle
-           DWORD dwRop       // raster operation code
-	)
-{
-  if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
-  {
-    return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
-                           hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
-  }
-  
-  return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc,
-                     nXOriginSrc, nYOriginSrc, dwRop);
-}

Added: trunk/reactos/lib/gdi32/objects/bitmap.c
--- trunk/reactos/lib/gdi32/objects/bitmap.c	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/objects/bitmap.c	2005-03-20 12:30:06 UTC (rev 14217)
@@ -0,0 +1,59 @@
+#include "precomp.h"
+
+/*
+ * @implemented
+ */
+HBITMAP STDCALL
+CreateDIBSection(
+   HDC hDC,
+   CONST BITMAPINFO *BitmapInfo,
+   UINT Usage,
+   VOID **Bits,
+   HANDLE hSection,
+   DWORD dwOffset)
+{
+   PBITMAPINFO pConvertedInfo;
+   UINT ConvertedInfoSize;
+   HBITMAP hBitmap = NULL;
+
+   pConvertedInfo = ConvertBitmapInfo(BitmapInfo, Usage,
+                                      &ConvertedInfoSize, FALSE);
+   if (pConvertedInfo)
+   {
+      hBitmap = NtGdiCreateDIBSection(hDC, pConvertedInfo, Usage, Bits,
+                                      hSection, dwOffset);
+      if (BitmapInfo != pConvertedInfo)
+         RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
+   }
+
+   return hBitmap;
+}
+
+/*
+ * @implemented
+ */
+BOOL STDCALL
+StretchBlt(
+   HDC hdcDest,      /* handle to destination DC */
+   int nXOriginDest, /* x-coord of destination upper-left corner */
+   int nYOriginDest, /* y-coord of destination upper-left corner */
+   int nWidthDest,   /* width of destination rectangle */
+   int nHeightDest,  /* height of destination rectangle */
+   HDC hdcSrc,       /* handle to source DC */
+   int nXOriginSrc,  /* x-coord of source upper-left corner */
+   int nYOriginSrc,  /* y-coord of source upper-left corner */
+   int nWidthSrc,    /* width of source rectangle */
+   int nHeightSrc,   /* height of source rectangle */
+   DWORD dwRop)      /* raster operation code */
+	
+{
+   if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
+   {
+      return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
+                             nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc,
+                             nWidthSrc, nHeightSrc, dwRop);
+   }
+  
+   return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
+                      nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, dwRop);
+}

Modified: trunk/reactos/lib/gdi32/objects/utils.c
--- trunk/reactos/lib/gdi32/objects/utils.c	2005-03-20 12:15:51 UTC (rev 14216)
+++ trunk/reactos/lib/gdi32/objects/utils.c	2005-03-20 12:30:06 UTC (rev 14217)
@@ -24,7 +24,7 @@
 
 BOOL STDCALL
 CalculateColorTableSize(
-   LPBITMAPINFOHEADER BitmapInfoHeader,
+   CONST BITMAPINFOHEADER *BitmapInfoHeader,
    UINT *ColorSpec,
    UINT *ColorTableSize)
 {
@@ -170,12 +170,12 @@
 
 LPBITMAPINFO STDCALL
 ConvertBitmapInfo(
-   LPBITMAPINFO BitmapInfo,
+   CONST BITMAPINFO *BitmapInfo,
    UINT ColorSpec,
    UINT *BitmapInfoSize,
    BOOL FollowedByData)
 {
-   LPBITMAPINFO NewBitmapInfo = BitmapInfo;
+   LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
    LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
    DWORD Size = 0;
    ULONG DataSize = 0;