Giovanni Mascellani : mfplat/tests: Test interaction between Lock2D() and LockRect().

Alexandre Julliard julliard at winehq.org
Thu Jun 16 16:38:07 CDT 2022


Module: wine
Branch: master
Commit: 433845277ba7a019737dad2050d51c7d38df9316
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=433845277ba7a019737dad2050d51c7d38df9316

Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date:   Tue Jun 14 17:15:47 2022 +0200

mfplat/tests: Test interaction between Lock2D() and LockRect().

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfplat/tests/mfplat.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 2cd27ed1269..67cf8954c36 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -6526,9 +6526,23 @@ static void test_MFCreateDXSurfaceBuffer(void)
     hr = IMF2DBuffer_GetScanline0AndPitch(_2dbuffer, &data, &pitch);
     ok(hr == HRESULT_FROM_WIN32(ERROR_WAS_UNLOCKED), "Unexpected hr %#lx.\n", hr);
 
+    hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0);
+    ok(hr == S_OK, "Failed to lock back buffer, hr %#lx.\n", hr);
+
+    /* Cannot lock the buffer while the surface is locked. */
+    hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch);
+    ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
+
+    hr = IDirect3DSurface9_UnlockRect(backbuffer);
+    ok(hr == S_OK, "Failed to unlock back buffer, hr %#lx.\n", hr);
+
     hr = IMF2DBuffer_Lock2D(_2dbuffer, &data, &pitch);
     ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 
+    /* Cannot lock the surface once the buffer is locked. */
+    hr = IDirect3DSurface9_LockRect(backbuffer, &locked_rect, NULL, 0);
+    ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
+
     hr = IMF2DBuffer_GetScanline0AndPitch(_2dbuffer, &data, &pitch);
     ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
 




More information about the wine-cvs mailing list