From 3e2d9462909558e2261000eab10936deea20a0b9 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 25 Apr 2012 21:24:20 +0200 Subject: [PATCH] d3d9: Properly retrieve an interface pointer in IDirect3DDevice9Impl_GetTexture(). --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 812de685d00..c5dc834cc05 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1691,6 +1691,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(IDirect3DDevice9Ex *iface, { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); struct wined3d_texture *wined3d_texture = NULL; + struct d3d9_texture *texture_impl; HRESULT hr; TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, ppTexture); @@ -1703,7 +1704,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(IDirect3DDevice9Ex *iface, hr = wined3d_device_get_texture(This->wined3d_device, Stage, &wined3d_texture); if (SUCCEEDED(hr) && wined3d_texture) { - *ppTexture = wined3d_texture_get_parent(wined3d_texture); + texture_impl = wined3d_texture_get_parent(wined3d_texture); + *ppTexture = &texture_impl->IDirect3DBaseTexture9_iface; IDirect3DBaseTexture9_AddRef(*ppTexture); wined3d_texture_decref(wined3d_texture); }