Commit 5673d82b authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

gdiplus: GpBitmap can be only locked once, get rid of numlocks field.

parent 0eaaa151
......@@ -391,7 +391,6 @@ struct GpBitmap{
INT height;
PixelFormat format;
ImageLockMode lockmode;
INT numlocks;
BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */
HBITMAP hbitmap;
HDC hdc;
......
......@@ -1071,7 +1071,6 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
bitmap->stride * act_rect.Y;
bitmap->lockmode = flags | ImageLockModeRead;
bitmap->numlocks++;
image_unlock(&bitmap->image, unlock);
return Ok;
......@@ -1148,7 +1147,6 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
}
bitmap->lockmode = flags | ImageLockModeRead;
bitmap->numlocks++;
bitmap->lockx = act_rect.X;
bitmap->locky = act_rect.Y;
......@@ -1190,9 +1188,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
}
if(!(lockeddata->Reserved & ImageLockModeWrite)){
if(!(--bitmap->numlocks))
bitmap->lockmode = 0;
bitmap->lockmode = 0;
heap_free(bitmap->bitmapbits);
bitmap->bitmapbits = NULL;
image_unlock(&bitmap->image, unlock);
......@@ -1203,7 +1199,6 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
{
/* we passed a direct reference; no need to do anything */
bitmap->lockmode = 0;
bitmap->numlocks = 0;
image_unlock(&bitmap->image, unlock);
return Ok;
}
......@@ -1228,7 +1223,6 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
heap_free(bitmap->bitmapbits);
bitmap->bitmapbits = NULL;
bitmap->lockmode = 0;
bitmap->numlocks = 0;
image_unlock(&bitmap->image, unlock);
return stat;
......
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