Author: greatlrd
Date: Sat Nov 29 04:29:37 2008
New Revision: 37720
URL:
http://svn.reactos.org/svn/reactos?rev=37720&view=rev
Log:
add GdiGetBitmapBitsSize it is a new api from windows xp sp3, the code have been tested in
vs2003
Modified:
branches/reactx/reactos/dll/win32/gdi32/gdi32.def
branches/reactx/reactos/dll/win32/gdi32/include/gdi32p.h
branches/reactx/reactos/dll/win32/gdi32/misc/stubs.c
Modified: branches/reactx/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/dll/win32/gdi32/…
==============================================================================
--- branches/reactx/reactos/dll/win32/gdi32/gdi32.def [iso-8859-1] (original)
+++ branches/reactx/reactos/dll/win32/gdi32/gdi32.def [iso-8859-1] Sat Nov 29 04:29:37
2008
@@ -622,3 +622,4 @@
bMakePathNameW@16
cGetTTFFromFOT@28
gdiPlaySpoolStream@24
+GdiGetBitmapBitsSize@4
Modified: branches/reactx/reactos/dll/win32/gdi32/include/gdi32p.h
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/dll/win32/gdi32/…
==============================================================================
--- branches/reactx/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ branches/reactx/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Sat Nov 29
04:29:37 2008
@@ -232,5 +232,9 @@
DWORD STDCALL GdiGetCodePage(HDC);
+int
+WINAPI
+GdiGetBitmapBitsSize(BITMAPINFO *lpbmi);
+
/* EOF */
Modified: branches/reactx/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/dll/win32/gdi32/…
==============================================================================
--- branches/reactx/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original)
+++ branches/reactx/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Sat Nov 29 04:29:37
2008
@@ -20,6 +20,50 @@
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again
later.\n", __FUNCTION__);
+
+
+
+/*
+ * @implemented
+ */
+int
+WINAPI
+GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
+{
+ int retSize;
+
+ if (lpbmi->bmiHeader.biSize == FIELD_OFFSET(BITMAPINFOHEADER, biPlanes))
+ {
+ /* Calc the bits Size and align it*/
+ retSize = HIWORD(lpbmi->bmiHeader.biWidth) *
((LOWORD(lpbmi->bmiHeader.biWidth) *
+ LOWORD(lpbmi->bmiHeader.biHeight) *
HIWORD(lpbmi->bmiHeader.biHeight) + 31)
+ & -32) / 8;
+ }
+ else
+ {
+ if ( (lpbmi->bmiHeader.biCompression == BI_BITFIELDS) ||
+ (lpbmi->bmiHeader.biCompression == BI_RGB))
+ {
+ if (lpbmi->bmiHeader.biHeight >=0 )
+ {
+ /* Calc the bits Size and align it*/
+ retSize = lpbmi->bmiHeader.biHeight * ((lpbmi->bmiHeader.biWidth *
+ lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount +
31) & -32) / 8;
+ }
+ else
+ {
+ /* Make height postiive if it negitve then calc the bits Size and align
it*/
+ retSize = (-lpbmi->bmiHeader.biHeight) * ((lpbmi->bmiHeader.biWidth
*
+ lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount +
31) & -32) / 8;
+ }
+ }
+ else
+ {
+ retSize = lpbmi->bmiHeader.biSizeImage;
+ }
+ }
+ return retSize;
+}
/*
* @unimplemented