[PATCH 1/5] d3d9: Properly retrieve an interface pointer in IDirect3DDevice9Impl_GetSwapChain().

Henri Verbeet hverbeet at codeweavers.com
Tue Apr 24 13:54:11 CDT 2012


---
 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 602baac..7fd300fb 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -463,6 +463,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirec
 {
     IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface);
     struct wined3d_swapchain *wined3d_swapchain = NULL;
+    IDirect3DSwapChain9Impl *swapchain_impl;
     HRESULT hr;
 
     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
     hr = wined3d_device_get_swapchain(This->wined3d_device, swapchain_idx, &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);
        wined3d_swapchain_decref(wined3d_swapchain);
     }
-- 
1.7.3.4




More information about the wine-patches mailing list