[Bug 51899] 16-bit Collins Dictionary has black background.

WineHQ Bugzilla wine-bugs at winehq.org
Thu Oct 21 08:04:54 CDT 2021


https://bugs.winehq.org/show_bug.cgi?id=51899

--- Comment #3 from O. Nykyforchyn <oleh.nyk at gmail.com> ---
I localized a narrow place in dlls/gdi32/dc. There is a function

DC_ATTR *get_dc_attr( HDC hdc )
{
    DWORD type = gdi_handle_type( hdc );
    DC_ATTR *dc_attr;
    if ((type & 0x1f0000) != NTGDI_OBJ_DC || !(dc_attr = get_gdi_client_ptr(
hdc, 0 )))
    {
        SetLastError( ERROR_INVALID_HANDLE );
        return NULL;
    }
    return dc_attr->disabled ? NULL : dc_attr;
}

If the first of two OR'ed conditions is dropped:

DC_ATTR *get_dc_attr( HDC hdc )
{
    DWORD type = gdi_handle_type( hdc );
    DC_ATTR *dc_attr;

    TRACE("Got type %x\n", type);

    if (!(dc_attr = get_gdi_client_ptr( hdc, 0 )))
    {
        SetLastError( ERROR_INVALID_HANDLE );
        return NULL;
    }
    return dc_attr->disabled ? NULL : dc_attr;
}

then background is OK. Splitting like

DC_ATTR *get_dc_attr( HDC hdc )
{
    DWORD type = gdi_handle_type( hdc );
    DC_ATTR *dc_attr;

    if ((type & 0x1f0000) != NTGDI_OBJ_DC)
    {
        SetLastError( ERROR_INVALID_HANDLE );
        return NULL;
    }

    if (!(dc_attr = get_gdi_client_ptr( hdc, 0 )))
    {
        SetLastError( ERROR_INVALID_HANDLE );
        return NULL;
    }
    return dc_attr->disabled ? NULL : dc_attr;
}

does not help. Seems like a compiler bug, maybe in oplimization or inlining.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list