Module: wine Branch: master Commit: 8ebc82cd8dbf306256318047d5b9c009f654eac1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ebc82cd8dbf306256318047d5...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Jul 1 07:52:29 2014 +0200
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 6452a9b..e0fdf81 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 1a5d9de..7e0e925 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 8bd9317..b96330c 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 92e6e99..393cea3 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. */