[ros-kernel] bug found - need help
Royce Mitchell III
royce3 at ev1.net
Mon Mar 22 08:08:26 CET 2004
Ge van Geldorp wrote:
>The DIB_GetPixel (and other DIB_* function pointers) should be used by
>the DIB engine (Eng* functions) only. The Eng* functions make sure they
>work on a DIB by copying the device dependent bitmap (the screen is a
>special case of this) to a DIB if needed. They then do their work on the
>DIB, using the DIB_* function pointers, and finally the DIB is copied
>back to the device dependent bitmap. So the fact that DIB_GetPixel has a
>value is normal even for a VGA screen DC, it is used by the Eng*
>functions after creating a copy DIB.
>
>The problem is in NtGdiGetPixel(). It wrongly assumes the underlying
>bitmap of the DC is in DIB format. This is not always the case and so
>NtGdiGetPixel() shouldn't be calling through the DIB_GetPixel function
>pointer. Instead, it should create a 1x1 DIB, bitblt the required pixel
>to the DIB and return the value obtained from the DIB. Of course, this
>will slow down things quite a bit....
>
>
I did kinda suspect there to be a problem with NtGdiGetPixel, but
couldn't put my finger on it.
Would this (pseudo-code) be ok?
if ( pvScan0 && DIB_GetPixel )
return DIB_GetPixel()
else if ( !pvScan0 && DrvGetPixel )
return DrvGetPixel()
else
create 1x1 DIB and bitblt the pixel in, then call DIB_GetPixel on it.
Thanks,
Royce3
More information about the Ros-kernel
mailing list