Vincent Povirk : gdiplus: Copy the bits on bitmap unlock if the write flag is set.

Alexandre Julliard julliard at winehq.org
Fri Feb 25 11:19:44 CST 2011


Module: wine
Branch: master
Commit: 58eb96c9e79088383d0f17cbcd82fb88013f500c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=58eb96c9e79088383d0f17cbcd82fb88013f500c

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu Feb 24 16:09:17 2011 -0600

gdiplus: Copy the bits on bitmap unlock if the write flag is set.

The read and write flags are independent, so a read flag being set doesn't
imply we can quit early.

---

 dlls/gdiplus/image.c       |    2 +-
 dlls/gdiplus/tests/image.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index a69046d..3c4e9bf 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -1048,7 +1048,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
     if(lockeddata->Reserved & ImageLockModeUserInputBuf)
         return NotImplemented;
 
-    if(lockeddata->Reserved & ImageLockModeRead){
+    if(!(lockeddata->Reserved & ImageLockModeWrite)){
         if(!(--bitmap->numlocks))
             bitmap->lockmode = 0;
 
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index dde040a..82d7588 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -657,7 +657,7 @@ static void test_LockBits(void)
 
     stat = GdipBitmapGetPixel(bm, 2, 3, &color);
     expect(Ok, stat);
-    todo_wine expect(0xffff8800, color);
+    expect(0xffff8800, color);
 
     /* write, conversion */
     stat = GdipBitmapLockBits(bm, &rect, ImageLockModeWrite, PixelFormat32bppARGB, &bd);




More information about the wine-cvs mailing list