Commit 31576d40 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Avoid locking in BITMAP_CopyBitmap.

parent 630c976f
...@@ -510,14 +510,10 @@ LONG WINAPI SetBitmapBits( ...@@ -510,14 +510,10 @@ LONG WINAPI SetBitmapBits(
*/ */
HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap) HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap)
{ {
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC );
HBITMAP res = 0; HBITMAP res = 0;
BITMAP bm; BITMAP bm;
if(!bmp) return 0; if (!GetObjectW( hbitmap, sizeof(bm), &bm )) return 0;
bm = bmp->bitmap;
bm.bmBits = NULL;
res = CreateBitmapIndirect(&bm); res = CreateBitmapIndirect(&bm);
if(res) { if(res) {
...@@ -527,8 +523,6 @@ HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap) ...@@ -527,8 +523,6 @@ HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap)
SetBitmapBits (res, bm.bmWidthBytes * bm.bmHeight, buf); SetBitmapBits (res, bm.bmWidthBytes * bm.bmHeight, buf);
HeapFree( GetProcessHeap(), 0, buf ); HeapFree( GetProcessHeap(), 0, buf );
} }
GDI_ReleaseObj( hbitmap );
return res; return res;
} }
......
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