[ros-kernel] bug found - need help

Royce Mitchell III royce3 at ev1.net
Mon Mar 22 10:39:33 CET 2004


Ge van Geldorp wrote:

>
>Since DIB_GetPixel should always be non-NULL, you could simplify the
>first test. eng/misc.c uses the following test to decide whether a
>surface is a DIB, safe to draw upon directly without having to make a
>DIB copy first:
>
>STYPE_BITMAP == Surf->iType || (NULL != Surf->pvScan0 && NULL !=
>Surf->lDelta)
>
>  
>
I think checking pvScan0 and lDelta are more than sufficient. This check 
you have quoted here appears deceptively wrong. I think prefer something 
like this would be more appropriate:

if ( STYPE_BITMAP == Surf->iType )
{
    ASSERT ( Surf->pvScan0 && Surf->lDelta );
    ....

>DrvGetPixel doesn't seem to exist (or am I missing something???).
>It might be possible to create the 1x1 DIB only once and reuse it again
>and again (serialize access via a FastMutex to avoid multi-threading
>issues). If you create it as a 32bpp DIB you can access its single pixel
>directly, without having to go through DIB_GetPixel and without the
>XLATEOBJ voodoo needed in the current NtGdiGetPixel() implementation.
>
>  
>
I can't seem to find DrvGetPixel, either. Neither in our code nor on the 
web. :(

Could you give me some pointers on how to go about creating a 32-bit DIB 
in kmode, if you get a chance? Thanks!



More information about the Ros-kernel mailing list