Module: wine Branch: master Commit: c2cf1935635d348ea1ffdcfebbbe08b71b65d157 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c2cf1935635d348ea1ffdcfebb...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Dec 9 11:51:17 2009 +0100
d3d9: Forward the volume's GetDevice() to the texture instead of the wined3d volume.
---
dlls/d3d9/volume.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c index 0d83ce1..baa286b 100644 --- a/dlls/d3d9/volume.c +++ b/dlls/d3d9/volume.c @@ -94,21 +94,24 @@ static ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) { }
/* IDirect3DVolume9 Interface follow: */ -static HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(LPDIRECT3DVOLUME9 iface, IDirect3DDevice9** ppDevice) { +static HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(IDirect3DVolume9 *iface, IDirect3DDevice9 **device) +{ IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface; - IWineD3DDevice *myDevice = NULL; + IDirect3DResource9 *resource; + HRESULT hr;
- TRACE("iface %p, device %p.\n", iface, ppDevice); + TRACE("iface %p, device %p.\n", iface, device);
- wined3d_mutex_lock(); - - IWineD3DVolume_GetDevice(This->wineD3DVolume, &myDevice); - IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); + hr = IUnknown_QueryInterface(This->forwardReference, &IID_IDirect3DResource9, (void **)&resource); + if (SUCCEEDED(hr)) + { + hr = IDirect3DResource9_GetDevice(resource, device); + IDirect3DResource9_Release(resource);
- wined3d_mutex_unlock(); + TRACE("Returning device %p.\n", *device); + }
- return D3D_OK; + return hr; }
static HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {