Commit 11a2231c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Properly retrieve an interface pointer in IDirect3DDevice9Impl_GetSwapChain().

parent 6b9cfd26
...@@ -463,6 +463,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirec ...@@ -463,6 +463,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirec
{ {
IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface);
struct wined3d_swapchain *wined3d_swapchain = NULL; struct wined3d_swapchain *wined3d_swapchain = NULL;
IDirect3DSwapChain9Impl *swapchain_impl;
HRESULT hr; HRESULT hr;
TRACE("iface %p, swapchain_idx %u, swapchain %p.\n", iface, swapchain_idx, swapchain); TRACE("iface %p, swapchain_idx %u, swapchain %p.\n", iface, swapchain_idx, swapchain);
...@@ -471,7 +472,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirec ...@@ -471,7 +472,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirec
hr = wined3d_device_get_swapchain(This->wined3d_device, swapchain_idx, &wined3d_swapchain); hr = wined3d_device_get_swapchain(This->wined3d_device, swapchain_idx, &wined3d_swapchain);
if (SUCCEEDED(hr) && wined3d_swapchain) if (SUCCEEDED(hr) && wined3d_swapchain)
{ {
*swapchain = wined3d_swapchain_get_parent(wined3d_swapchain); swapchain_impl = wined3d_swapchain_get_parent(wined3d_swapchain);
*swapchain = &swapchain_impl->IDirect3DSwapChain9_iface;
IDirect3DSwapChain9_AddRef(*swapchain); IDirect3DSwapChain9_AddRef(*swapchain);
wined3d_swapchain_decref(wined3d_swapchain); wined3d_swapchain_decref(wined3d_swapchain);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment