From 9cb7ca004a3d9a87466485fcbc2e3df3b71fac93 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 9 Apr 2012 20:43:38 +0200 Subject: [PATCH] ddraw: Properly retrieve an interface pointer in ddraw7_GetSurfaceFromDC(). --- dlls/ddraw/ddraw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 2ef51daff17..a777d359497 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2471,6 +2471,7 @@ static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC hdc, { struct ddraw *ddraw = impl_from_IDirectDraw7(iface); struct wined3d_surface *wined3d_surface; + struct ddraw_surface *surface_impl; HRESULT hr; TRACE("iface %p, dc %p, surface %p.\n", iface, hdc, Surface); @@ -2485,7 +2486,8 @@ static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC hdc, return DDERR_NOTFOUND; } - *Surface = wined3d_surface_get_parent(wined3d_surface); + surface_impl = wined3d_surface_get_parent(wined3d_surface); + *Surface = &surface_impl->IDirectDrawSurface7_iface; IDirectDrawSurface7_AddRef(*Surface); TRACE("Returning surface %p.\n", Surface); return DD_OK;