From e780ee581d9b2d47259651c4e7952768955a6b6b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 3 Dec 2013 09:59:19 +0100 Subject: [PATCH] ddraw: Return the correct error in ddraw_surface7_Flip() when the surface is not flippable. --- dlls/ddraw/surface.c | 4 +--- dlls/ddraw/tests/ddraw1.c | 6 +++--- dlls/ddraw/tests/ddraw2.c | 6 +++--- dlls/ddraw/tests/ddraw4.c | 6 +++--- dlls/ddraw/tests/ddraw7.c | 6 +++--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 980b83a4d24..8403a32f083 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1197,10 +1197,8 @@ static HRESULT WINAPI ddraw_surface7_Flip(IDirectDrawSurface7 *iface, IDirectDra TRACE("iface %p, dst %p, flags %#x.\n", iface, DestOverride, Flags); - /* Flip has to be called from a front buffer - * What about overlay surfaces, AFAIK they can flip too? */ if (!(surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY))) - return DDERR_INVALIDOBJECT; /* Unchecked */ + return DDERR_NOTFLIPPABLE; wined3d_mutex_lock(); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 7dac193b0ea..2d62ec65fca 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3625,11 +3625,11 @@ static void test_flip(void) hr = IDirectDrawSurface_Flip(primary, primary, DDFLIP_WAIT); todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer3, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index c70b98c08ef..bb07bea7803 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -4306,11 +4306,11 @@ static void test_flip(void) hr = IDirectDrawSurface_Flip(primary, primary, DDFLIP_WAIT); todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(backbuffer3, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index dc9a282d24b..376d80e3f85 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -4910,11 +4910,11 @@ static void test_flip(void) hr = IDirectDrawSurface4_Flip(primary, primary, DDFLIP_WAIT); todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(backbuffer1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(backbuffer2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(backbuffer3, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 743c4a203e0..400a8bcdd41 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -4797,11 +4797,11 @@ static void test_flip(void) hr = IDirectDrawSurface7_Flip(primary, primary, DDFLIP_WAIT); todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(backbuffer1, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(backbuffer2, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(backbuffer3, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr); memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx);