ddraw: Implement ddraw7_RestoreAllSurfaces().

This commit is contained in:
Henri Verbeet 2014-06-30 11:17:04 +02:00 committed by Alexandre Julliard
parent 8d4988a43f
commit 881219354f
3 changed files with 13 additions and 20 deletions

View File

@ -2675,27 +2675,20 @@ static HRESULT WINAPI ddraw4_GetSurfaceFromDC(IDirectDraw4 *iface, HDC dc,
return hr;
}
/*****************************************************************************
* IDirectDraw7::RestoreAllSurfaces
*
* Calls the restore method of all surfaces
*
* Params:
*
* Returns:
* Always returns DD_OK because it's a stub
*
*****************************************************************************/
static HRESULT CALLBACK restore_callback(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context)
{
IDirectDrawSurface_Restore(surface);
IDirectDrawSurface_Release(surface);
return DDENUMRET_OK;
}
static HRESULT WINAPI ddraw7_RestoreAllSurfaces(IDirectDraw7 *iface)
{
FIXME("iface %p stub!\n", iface);
TRACE("iface %p.\n", iface);
/* This isn't hard to implement: Enumerate all WineD3D surfaces,
* get their parent and call their restore method. Do not implement
* it in WineD3D, as restoring a surface means re-creating the
* WineD3DDSurface
*/
return DD_OK;
return IDirectDraw7_EnumSurfaces(iface, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST,
NULL, NULL, restore_callback);
}
static HRESULT WINAPI ddraw4_RestoreAllSurfaces(IDirectDraw4 *iface)

View File

@ -7718,7 +7718,7 @@ static void test_lost_device(void)
hr = IDirectDraw4_TestCooperativeLevel(ddraw);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_IsLost(surface);
todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface4_Release(surface);
refcount = IDirectDraw4_Release(ddraw);

View File

@ -7440,7 +7440,7 @@ static void test_lost_device(void)
hr = IDirectDraw7_TestCooperativeLevel(ddraw);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_IsLost(surface);
todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface7_Release(surface);
refcount = IDirectDraw7_Release(ddraw);