[PATCH v2] win32u: Don't use get_dc_ptr() in __wine_get_wgl_driver().

Jacek Caban jacek at codeweavers.com
Tue Mar 1 10:45:08 CST 2022


Hi Paul,

On 2/24/22 14:15, Paul Gofman wrote:
> +/***********************************************************************
> + *      __wine_get_wgl_driver  (win32u.@)
> + */
> +struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
> +{
> +    BOOL dibdrv;
> +    DC * dc;
> +
> +    if (!(dc = get_dc_obj( hdc ))) return NULL;
> +    if (dc->attr->disabled)
> +    {
> +        GDI_ReleaseObj( hdc );
> +        return NULL;
> +    }
> +    dibdrv = !dc->is_display;
> +    GDI_ReleaseObj( hdc );
> +
> +    if (dibdrv)
> +    {
> +        if (version != WINE_WGL_DRIVER_VERSION)
> +        {
> +            ERR( "version mismatch, opengl32 wants %u but dibdrv has %u\n", version, WINE_WGL_DRIVER_VERSION );
> +            return NULL;
> +        }
> +        return dibdrv_get_wgl_driver();
> +    }
> +    return user_driver->pwine_get_wgl_driver( version );
> +}


I didn't mean to suggest dropping the check for memdc, this changes 
behaviour over current code. Although such change may make some sense 
(I'm not sure), it would least deserve a separated commit and 
consideration about stock bitmap handling in osmesa code. How about 
doing it like in the attached, modified version of your patch?


Thanks,

Jacek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 18061 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220301/6ebf0032/attachment.bin>


More information about the wine-devel mailing list