Author: greatlrd
Date: Mon Sep 4 02:54:22 2006
New Revision: 23904
URL:
http://svn.reactos.org/svn/reactos?rev=23904&view=rev
Log:
Adding small hack to getting SetPixel color right when it is more that 3 bytes long.
This hack allown us pass one more test. (Debuging in progress)
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Mon Sep 4 02:54:22 2006
@@ -485,14 +485,16 @@
{
if (pBmp->dib == NULL)
{
- ExFreePool(pBmp->SurfObj.pvBits);
+ if (pBmp->SurfObj.pvBits != NULL)
+ ExFreePool(pBmp->SurfObj.pvBits);
}
else
{
- EngFreeUserMem(pBmp->SurfObj.pvBits);
- }
- if (pBmp->hDIBPalette)
- {
+ if (pBmp->SurfObj.pvBits != NULL)
+ EngFreeUserMem(pBmp->SurfObj.pvBits);
+ }
+ if (pBmp->hDIBPalette != NULL)
+ {
NtGdiDeleteObject(pBmp->hDIBPalette);
}
}
@@ -1066,11 +1068,27 @@
INT Y,
COLORREF Color)
{
+
+ DPRINT1("0 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+
+ if (((Color>>24) & 0xff)<0x10)
+ {
+ Color = ((Color>>16) & 0x0000ff) | ((Color<<16) & 0xff0000) |
(Color & 0x00ff00);
+ }
+
+ DPRINT1("0 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+
if (NtGdiSetPixelV(hDC,X,Y,Color))
{
- return NtGdiGetPixel(hDC,X,Y);
- }
- return ((COLORREF) -1);
+ Color = NtGdiGetPixel(hDC,X,Y);
+ DPRINT1("1 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+ return Color;
+
+ }
+
+ Color = ((COLORREF) -1);
+ DPRINT1("2 NtGdiSetPixel X %ld Y %ld C %ld\n",X,Y,Color);
+ return Color;
}
BOOL STDCALL