[PATCH] d2d1/tests: Test to show that WIC bitmap is locked within BeginDraw()/EndDraw()

Nikolay Sivov nsivov at codeweavers.com
Thu Feb 16 09:09:21 CST 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/d2d1/tests/d2d1.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 5c6f346eb7..19efd73465 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -3971,6 +3971,7 @@ static void test_gdi_interop(void)
     ID2D1GdiInteropRenderTarget *interop;
     D2D1_RENDER_TARGET_PROPERTIES desc;
     IWICImagingFactory *wic_factory;
+    IWICBitmapLock *wic_lock;
     IWICBitmap *wic_bitmap;
     ID2D1RenderTarget *rt;
     ID2D1Factory *factory;
@@ -4065,6 +4066,19 @@ todo_wine
     match = compare_wic_bitmap(wic_bitmap, "60cacbf3d72e1e7834203da608037b1bf83b40e8");
     ok(match, "Bitmap does not match.\n");
 
+    /* Bitmap is locked at BeginDraw(). */
+    hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock);
+    ok(SUCCEEDED(hr), "Expected bitmap to be unlocked, hr %#x.\n", hr);
+    IWICBitmapLock_Release(wic_lock);
+
+    ID2D1RenderTarget_BeginDraw(rt);
+    hr = IWICBitmap_Lock(wic_bitmap, NULL, WICBitmapLockRead, &wic_lock);
+todo_wine
+    ok(hr == WINCODEC_ERR_ALREADYLOCKED, "Expected bitmap to be locked, hr %#x.\n", hr);
+    if (SUCCEEDED(hr))
+        IWICBitmapLock_Release(wic_lock);
+    ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
+
     ID2D1GdiInteropRenderTarget_Release(interop);
     ID2D1RenderTarget_Release(rt);
 
-- 
2.11.0




More information about the wine-patches mailing list