Commit 42470bae authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw/tests: Test SetSurfaceDesc and Lock interaction.

parent 5e43ee25
......@@ -4467,7 +4467,21 @@ static void test_set_surface_desc(void)
/* Redundantly setting the same lpSurface is not an error. */
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface3_Lock(surface3, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface3_Unlock(surface3, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);
......
......@@ -5068,7 +5068,21 @@ static void test_set_surface_desc(void)
/* Redundantly setting the same lpSurface is not an error. */
hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface4_Lock(surface, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface4_Unlock(surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);
......
......@@ -4956,6 +4956,21 @@ static void test_set_surface_desc(void)
hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0);
ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr);
hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &ddsd);
ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == NULL, "lpSurface is %p, expected NULL.\n", ddsd.lpSurface);
hr = IDirectDrawSurface7_Lock(surface, NULL, &ddsd, 0, NULL);
ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr);
ok(!(ddsd.dwFlags & DDSD_LPSURFACE), "DDSD_LPSURFACE is set.\n");
ok(ddsd.lpSurface == data, "lpSurface is %p, expected %p.\n", data, data);
hr = IDirectDrawSurface7_Unlock(surface, NULL);
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE;
ddsd.lpSurface = data;
hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 1);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc with flags=1 returned %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment