Module: wine Branch: master Commit: fb5bc7240860fb5e603616be969729ef355e81f3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fb5bc7240860fb5e603616be96...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Apr 24 20:54:13 2012 +0200
d3d9: Properly retrieve an interface pointer in IDirect3DDevice9Impl_GetBackBuffer().
---
dlls/d3d9/device.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ddfaae6..20635a0 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -596,6 +596,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(IDirect3DDevice9Ex *ifa { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); struct wined3d_surface *wined3d_surface = NULL; + IDirect3DSurface9Impl *surface_impl; HRESULT hr;
TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", @@ -606,7 +607,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetBackBuffer(IDirect3DDevice9Ex *ifa BackBuffer, (enum wined3d_backbuffer_type)Type, &wined3d_surface); if (SUCCEEDED(hr) && wined3d_surface && ppBackBuffer) { - *ppBackBuffer = wined3d_surface_get_parent(wined3d_surface); + surface_impl = wined3d_surface_get_parent(wined3d_surface); + *ppBackBuffer = &surface_impl->IDirect3DSurface9_iface; IDirect3DSurface9_AddRef(*ppBackBuffer); wined3d_surface_decref(wined3d_surface); }