Don't hold the GDI lock when calling DC_GetDCUpdate.

This commit is contained in:
Huw Davies 2005-02-22 19:34:33 +00:00 committed by Alexandre Julliard
parent 7eba925a4d
commit 8e34fa62ff
1 changed files with 7 additions and 4 deletions

View File

@ -314,12 +314,15 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
BITMAPOBJ *bitmap; BITMAPOBJ *bitmap;
INT result = 0; INT result = 0;
if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0;
if (!(dc = DC_GetDCUpdate( hdc ))) if (!(dc = DC_GetDCUpdate( hdc )))
{ {
if (coloruse == DIB_RGB_COLORS) FIXME( "shouldn't require a DC for DIB_RGB_COLORS\n" ); if (coloruse == DIB_RGB_COLORS) FIXME( "shouldn't require a DC for DIB_RGB_COLORS\n" );
GDI_ReleaseObj( hbitmap ); return 0;
}
if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
{
GDI_ReleaseObj( hdc );
return 0; return 0;
} }
@ -332,8 +335,8 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
result = lines; result = lines;
done: done:
GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hbitmap ); GDI_ReleaseObj( hbitmap );
GDI_ReleaseObj( hdc );
return result; return result;
} }