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

Alexandre Julliard julliard at winehq.org
Wed Apr 25 13:40:25 CDT 2012


Module: wine
Branch: master
Commit: 11a2231c11b2deeaec6c65a1c2fbb92558348e0f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=11a2231c11b2deeaec6c65a1c2fbb92558348e0f

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 24 20:54:11 2012 +0200

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

---

 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);
     }




More information about the wine-cvs mailing list