GetObject with empty buffer

Uwe Bonnes bon at
Thu Aug 29 07:09:49 CDT 2002

>>>>> "Fabian" == Fabian Cenedese <Cenedese at> writes:


    Fabian> <MSDN> If the lpvObject parameter is NULL, the function return
    Fabian> value is the number of bytes required to store the information
    Fabian> it writes to the buffer for the specified graphics object.
    Fabian> </MSDN>

    Fabian> But I couldn't find this anywhere, not in the general function
    Fabian> in gdiobj.c nor in the subtypes FONT_GetObject or
    Fabian> BRUSH_GetObject (sure others neither).  As my app uses this
    Fabian> feature Wine tries to memcpy to a NULL pointer and jumps out of
    Fabian> the window... literally :)

FONT_GetObject sure checks:

        memcpy( buffer, &lfA, count );
    return count;

BRUSH_GetObject  does not:

    if (count > sizeof(brush->logbrush)) count = sizeof(brush->logbrush);
    memcpy( buffer, &brush->logbrush, count );
    return count;

Someone has to carefully check all subtypes...

Uwe Bonnes                bon at

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the wine-devel mailing list