gdi32: Avoid locking in BITMAP_CopyBitmap.

This commit is contained in:
Alexandre Julliard 2008-02-05 18:26:25 +01:00
parent 630c976f88
commit 31576d408e
1 changed files with 1 additions and 7 deletions

View File

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