Module: wine Branch: stable Commit: b0beb1c992c18aca5ff5fe2780f2669e11e1f1c6 URL: https://source.winehq.org/git/wine.git/?a=commit;h=b0beb1c992c18aca5ff5fe278... Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon Aug 5 21:58:32 2019 +0300 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(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 5c9a7b0986db30c9565af519e6cbdef157524315) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/ddraw/surface.c | 7 +++++++ dlls/ddraw/tests/ddraw7.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index c3490444fa..dfbe690c67 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -3729,6 +3729,7 @@ static HRESULT WINAPI ddraw_surface1_IsLost(IDirectDrawSurface *iface) static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); + unsigned int i; TRACE("iface %p.\n", iface); @@ -3769,6 +3770,12 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface) ddraw_update_lost_surfaces(surface->ddraw); 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; } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 4dda3841fa..b42eeb6b7d 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8957,6 +8957,13 @@ static void test_lost_device(void) hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &back_buffer); 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); refcount = IDirectDraw7_Release(ddraw);