Author: jimtabor
Date: Wed Aug 22 23:45:06 2007
New Revision: 28455
URL:
http://svn.reactos.org/svn/reactos?rev=28455&view=rev
Log:
- Removed NtGdiGetDIBits from w32ksvc.db and updated ntgdibad.h.
- Created support function for GetDIBits when calling NtGdiGetDIBitsInternal.
- Connected the gdi32 parts.
Modified:
trunk/reactos/dll/win32/gdi32/gdi32.def
trunk/reactos/dll/win32/gdi32/objects/bitmap.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.def?…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.def (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.def Wed Aug 22 23:45:06 2007
@@ -369,7 +369,7 @@
GetDCOrgEx@8
GetDCPenColor@4
GetDIBColorTable@16=NtGdiGetDIBColorTable@16
-GetDIBits@28=NtGdiGetDIBits@28
+GetDIBits@28
GetDeviceCaps@8=NtGdiGetDeviceCaps@8
GetDeviceGammaRamp@8
GetEnhMetaFileA@4
Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bi…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/bitmap.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c Wed Aug 22 23:45:06 2007
@@ -1,4 +1,31 @@
#include "precomp.h"
+
+/*
+ * Return the full scan size for a bitmap.
+ *
+ * Based on Wine and Windows Graphics Prog pg 595
+ */
+UINT
+FASTCALL
+DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )
+{
+ UINT MaxBits = 0;
+
+ if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
+ {
+ PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info;
+ MaxBits = Core->bcBitCount * Core->bcPlanes * Core->bcWidth;
+ }
+ else /* assume BITMAPINFOHEADER */
+ {
+ if ((Info->bmiHeader.biCompression) &&
(Info->bmiHeader.biCompression != BI_BITFIELDS))
+ return Info->bmiHeader.biSizeImage;
+ MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes *
Info->bmiHeader.biWidth;
+ }
+ // Planes are over looked by Yuan. I guess assumed always 1.
+ MaxBits = (MaxBits + 31) / 32; // ScanLineSize = (Width * bitcount + 31)/32
+ return (MaxBits * ScanLines); // ret the full Size.
+}
/*
* @implemented
@@ -144,3 +171,27 @@
FALSE,
NULL);
}
+
+
+INT
+STDCALL
+GetDIBits(
+ HDC hDC,
+ HBITMAP hbmp,
+ UINT uStartScan,
+ UINT cScanLines,
+ LPVOID lpvBits,
+ LPBITMAPINFO lpbmi,
+ UINT uUsage
+ )
+{
+ return NtGdiGetDIBitsInternal(hDC,
+ hbmp,
+ uStartScan,
+ cScanLines,
+ lpvBits,
+ lpbmi,
+ uUsage,
+ DIB_BitmapMaxBitsSize( lpbmi, cScanLines ),
+ 0);
+}
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Wed Aug 22 23:45:06 2007
@@ -317,20 +317,6 @@
RGBQUAD * Colors
);
-/* Use NtGdiGetDIBitsInternal. */
-INT
-STDCALL
-NtGdiGetDIBits (
- HDC hDC,
- HBITMAP hBitmap,
- UINT StartScan,
- UINT ScanLines,
- LPVOID Bits,
- LPBITMAPINFO bi,
- UINT Usage
- );
-
-
/* Meta are user-mode. */
HENHMETAFILE
STDCALL
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c Wed Aug 22 23:45:06 2007
@@ -1007,14 +1007,14 @@
bi.bmiHeader.biYPelsPerMeter = 0;
bi.bmiHeader.biClrUsed = 0;
- ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, NULL, &bi,
DIB_RGB_COLORS);
+ ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight, NULL,
&bi, DIB_RGB_COLORS, 0, 0);
size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER);
hCBData = ExAllocatePool(PagedPool, size);
memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER));
- ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData +
sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS);
+ ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight,
(LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
UserReleaseDC(NULL, hdc, FALSE);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Wed Aug 22 23:45:06 2007
@@ -352,13 +352,15 @@
/* Converts a device-dependent bitmap to a DIB */
INT STDCALL
-NtGdiGetDIBits(HDC hDC,
- HBITMAP hBitmap,
- UINT StartScan,
- UINT ScanLines,
- LPVOID Bits,
- LPBITMAPINFO Info,
- UINT Usage)
+NtGdiGetDIBitsInternal(HDC hDC,
+ HBITMAP hBitmap,
+ UINT StartScan,
+ UINT ScanLines,
+ LPBYTE Bits,
+ LPBITMAPINFO Info,
+ UINT Usage,
+ UINT MaxBits,
+ UINT MaxInfo)
{
BITMAPOBJ *BitmapObj;
SURFOBJ *DestSurfObj;
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Wed Aug 22 23:45:06 2007
@@ -180,7 +180,7 @@
NtGdiGetDeviceCaps 2
NtGdiGetDeviceGammaRamp 2
# NtGdiGetDeviceCapsAll 2
-# NtGdiGetDIBitsInternal 9
+NtGdiGetDIBitsInternal 9
# NtGdiGetETM 2
# NtGdiGetEudcTimeStampEx 3
NtGdiGetFontData 5
@@ -782,7 +782,6 @@
NtGdiGetCurrentObject 2
NtGdiGetCurrentPositionEx 2
NtGdiGetDIBColorTable 4
-NtGdiGetDIBits 7
NtGdiGetEnhMetaFile 1
NtGdiGetEnhMetaFileBits 3
NtGdiGetEnhMetaFileDescription 3