Nikolay Sivov : gdiplus: GdipDeleteGraphics affected by busy state too. Test added.

Alexandre Julliard julliard at winehq.org
Tue Aug 26 07:07:21 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Tue Aug 26 01:58:33 2008 +0400

gdiplus: GdipDeleteGraphics affected by busy state too. Test added.

---

 dlls/gdiplus/graphics.c       |    2 ++
 dlls/gdiplus/tests/graphics.c |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index bff1c86..ef2aff7 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -889,6 +889,8 @@ GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename,
 GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
 {
     if(!graphics) return InvalidParameter;
+    if(graphics->busy) return ObjectBusy;
+
     if(graphics->hwnd)
         ReleaseDC(graphics->hwnd, graphics->hdc);
 
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 90a416c..9770211 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -714,6 +714,9 @@ static void test_Get_Release_DC(void)
     status = GdipMultiplyWorldTransform(graphics, m, MatrixOrderPrepend);
     status = GdipGetClip(graphics, region);
     expect(ObjectBusy, status); status = Ok;
+    /* try to delete before release */
+    status = GdipDeleteGraphics(graphics);
+    expect(ObjectBusy, status);
 
     status = GdipReleaseDC(graphics, retdc);
     expect(Ok, status);




More information about the wine-cvs mailing list