[PATCH 4/5] mfplat/tests: Test interaction between Lock2D() and LockRect().

Giovanni Mascellani gmascellani at codeweavers.com
Mon Jun 13 08:14:31 CDT 2022


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 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 c9da9fecef4..16599532d8f 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -6520,9 +6520,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);
 
-- 
2.36.1




More information about the wine-devel mailing list