Commit 3036fef6 authored by Alexandre Julliard's avatar Alexandre Julliard

Refuse to select a bitmap that is already selected in another DC.

parent 8e5e003f
......@@ -70,9 +70,16 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap )
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!(dc->flags & DC_MEMORY)) return 0;
if (hbitmap == dc->hBitmap) return hbitmap; /* nothing to do */
if (!(bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0;
if (bmp->header.dwCount)
{
WARN( "Bitmap already selected in another DC\n" );
GDI_ReleaseObj( hbitmap );
return 0;
}
if(!bmp->physBitmap)
{
if(!X11DRV_CreateBitmap(hbitmap))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment