From 8ebc82cd8dbf306256318047d5b9c009f654eac1 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 1 Jul 2014 07:52:29 +0200 Subject: [PATCH] ddraw: Check for a lost surface in ddraw_surface7_Flip(). --- dlls/ddraw/surface.c | 3 +++ dlls/ddraw/tests/ddraw2.c | 2 +- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 6452a9bedd9..e0fdf81b379 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1227,6 +1227,9 @@ static HRESULT WINAPI ddraw_surface7_Flip(IDirectDrawSurface7 *iface, IDirectDra if (src == iface || !(dst_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY))) return DDERR_NOTFLIPPABLE; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + return DDERR_SURFACELOST; + wined3d_mutex_lock(); tmp = dst_impl->wined3d_surface; diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 1a5d9de0cfe..7e0e925dd9d 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -6610,7 +6610,7 @@ static void test_lost_device(void) hr = IDirectDrawSurface_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 8bd93175667..b96330cd458 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -7675,7 +7675,7 @@ static void test_lost_device(void) hr = IDirectDrawSurface4_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 92e6e999e74..393cea34b42 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -7397,7 +7397,7 @@ static void test_lost_device(void) hr = IDirectDrawSurface7_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */