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

Henri Verbeet hverbeet at codeweavers.com
Mon Apr 23 14:24:53 CDT 2012


---
 dlls/d3d8/device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 7d7b454..3dfd8f4 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2383,6 +2383,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(IDirect3DDevice8 *iface,
 {
     IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
     struct wined3d_buffer *retIndexData = NULL;
+    IDirect3DIndexBuffer8Impl *buffer_impl;
     HRESULT hr;
 
     TRACE("iface %p, buffer %p, base_vertex_index %p.\n", iface, ppIndexData, pBaseVertexIndex);
@@ -2397,7 +2398,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(IDirect3DDevice8 *iface,
     hr = wined3d_device_get_index_buffer(This->wined3d_device, &retIndexData);
     if (SUCCEEDED(hr) && retIndexData)
     {
-        *ppIndexData = wined3d_buffer_get_parent(retIndexData);
+        buffer_impl = wined3d_buffer_get_parent(retIndexData);
+        *ppIndexData = &buffer_impl->IDirect3DIndexBuffer8_iface;
         IDirect3DIndexBuffer8_AddRef(*ppIndexData);
         wined3d_buffer_decref(retIndexData);
     } else {
-- 
1.7.3.4




More information about the wine-patches mailing list