ddraw: Check for a lost surface in ddraw_surface7_Flip().

This commit is contained in:
Henri Verbeet 2014-07-01 07:52:29 +02:00 committed by Alexandre Julliard
parent 881219354f
commit 8ebc82cd8d
4 changed files with 6 additions and 3 deletions

View File

@ -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))) if (src == iface || !(dst_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY)))
return DDERR_NOTFLIPPABLE; return DDERR_NOTFLIPPABLE;
if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST)
return DDERR_SURFACELOST;
wined3d_mutex_lock(); wined3d_mutex_lock();
tmp = dst_impl->wined3d_surface; tmp = dst_impl->wined3d_surface;

View File

@ -6610,7 +6610,7 @@ static void test_lost_device(void)
hr = IDirectDrawSurface_IsLost(surface); hr = IDirectDrawSurface_IsLost(surface);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); 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 /* Trying to restore the primary will crash, probably because flippable
* surfaces can't exist in DDSCL_NORMAL. */ * surfaces can't exist in DDSCL_NORMAL. */

View File

@ -7675,7 +7675,7 @@ static void test_lost_device(void)
hr = IDirectDrawSurface4_IsLost(surface); hr = IDirectDrawSurface4_IsLost(surface);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); 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 /* Trying to restore the primary will crash, probably because flippable
* surfaces can't exist in DDSCL_NORMAL. */ * surfaces can't exist in DDSCL_NORMAL. */

View File

@ -7397,7 +7397,7 @@ static void test_lost_device(void)
hr = IDirectDrawSurface7_IsLost(surface); hr = IDirectDrawSurface7_IsLost(surface);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); 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 /* Trying to restore the primary will crash, probably because flippable
* surfaces can't exist in DDSCL_NORMAL. */ * surfaces can't exist in DDSCL_NORMAL. */