From 9936ec0c1c0bb9facae4008be2c6f1c99b138857 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 29 Apr 2012 20:52:03 +0200 Subject: [PATCH] d3d9: Properly retrieve an interface pointer in IDirect3DDevice9Impl_GetStreamSource(). --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index e497ce70367..3d8642df7b6 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2492,6 +2492,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(IDirect3DDevice9Ex *i { IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); struct wined3d_buffer *retStream = NULL; + IDirect3DVertexBuffer9Impl *buffer_impl; HRESULT hr; TRACE("iface %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", @@ -2505,7 +2506,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(IDirect3DDevice9Ex *i hr = wined3d_device_get_stream_source(This->wined3d_device, StreamNumber, &retStream, OffsetInBytes, pStride); if (SUCCEEDED(hr) && retStream) { - *pStream = wined3d_buffer_get_parent(retStream); + buffer_impl = wined3d_buffer_get_parent(retStream); + *pStream = &buffer_impl->IDirect3DVertexBuffer9_iface; IDirect3DVertexBuffer9_AddRef(*pStream); wined3d_buffer_decref(retStream); }