[ros-kernel] bug found - need help
Ge van Geldorp
ge at gse.nl
Mon Mar 22 10:49:35 CET 2004
> From: Royce Mitchell III
>
> DIB_4BPP_GetPixel() is getting called with a NULL in
> SurfObj->pvScan0, which is being called indirectly from
> NtGdiGetPixel()!
>
> Now, I can't figure out how DIB_4BPP_GetPixel() is getting
> assigned to the DC's DIB_GetPixel function pointer.
>
> It seems to me that pvScan0 *must* be non-NULL before
> DIB_4BPP_GetPixel could be assigned to a pointer for that DC.
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....
Ge van Geldorp.
More information about the Ros-kernel
mailing list