ddraw: Properly retrieve an interface pointer in IDirect3DDeviceImpl_7_GetTexture().

This commit is contained in:
Henri Verbeet 2012-04-09 20:43:39 +02:00 committed by Alexandre Julliard
parent 9cb7ca004a
commit 96fa113513
1 changed files with 3 additions and 1 deletions

View File

@ -4563,6 +4563,7 @@ IDirect3DDeviceImpl_7_GetTexture(IDirect3DDevice7 *iface,
{
IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface);
struct wined3d_texture *wined3d_texture;
struct ddraw_surface *surface;
HRESULT hr;
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, Texture);
@ -4582,7 +4583,8 @@ IDirect3DDeviceImpl_7_GetTexture(IDirect3DDevice7 *iface,
return hr;
}
*Texture = wined3d_texture_get_parent(wined3d_texture);
surface = wined3d_texture_get_parent(wined3d_texture);
*Texture = &surface->IDirectDrawSurface7_iface;
IDirectDrawSurface7_AddRef(*Texture);
wined3d_texture_decref(wined3d_texture);
wined3d_mutex_unlock();