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

This commit is contained in:
Alexandre Julliard 2001-08-20 19:19:18 +00:00
parent 8e5e003f09
commit 3036fef6a7
1 changed files with 8 additions and 1 deletions

View File

@ -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))