ddraw: Restore complex attached surfaces when restoring surface.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47586
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2019-08-05 21:58:32 +03:00 committed by Alexandre Julliard
parent 7361c7f2cd
commit 5c9a7b0986
2 changed files with 14 additions and 0 deletions

View File

@ -3732,6 +3732,7 @@ static HRESULT WINAPI ddraw_surface1_IsLost(IDirectDrawSurface *iface)
static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
{ {
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
unsigned int i;
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
@ -3772,6 +3773,12 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
ddraw_update_lost_surfaces(surface->ddraw); ddraw_update_lost_surfaces(surface->ddraw);
surface->is_lost = FALSE; surface->is_lost = FALSE;
for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
{
if (surface->complex_array[i])
surface->complex_array[i]->is_lost = FALSE;
}
return DD_OK; return DD_OK;
} }

View File

@ -9212,6 +9212,13 @@ static void test_lost_device(void)
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer); hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Restore(surface);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_IsLost(back_buffer);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface7_Release(back_buffer);
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(surface);
refcount = IDirectDraw7_Release(ddraw); refcount = IDirectDraw7_Release(ddraw);