Module: wine Branch: master Commit: 5673d82b8e90112d03e80fb709faec23644f9878 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5673d82b8e90112d03e80fb709... Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 14 10:24:43 2017 +0100 gdiplus: GpBitmap can be only locked once, get rid of numlocks field. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 1 - dlls/gdiplus/image.c | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 2e98065..dd210fc 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -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; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 4de8ecc..dd01f77 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -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;