Commit ff92e6eb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Simplify GetDevice().

parent 3cedef2f
...@@ -85,23 +85,18 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 ifa ...@@ -85,23 +85,18 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 ifa
} }
/* IDirect3DCubeTexture9 IDirect3DResource9 Interface follow: */ /* IDirect3DCubeTexture9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetDevice(LPDIRECT3DCUBETEXTURE9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetDevice(IDirect3DCubeTexture9 *iface, IDirect3DDevice9 **device)
{
IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface; IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DCubeTexture_GetDevice(This->wineD3DCubeTexture, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DCubeTexture9Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DCubeTexture9Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
...@@ -80,23 +80,18 @@ static ULONG WINAPI IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 ifa ...@@ -80,23 +80,18 @@ static ULONG WINAPI IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 ifa
} }
/* IDirect3DIndexBuffer9 IDirect3DResource9 Interface follow: */ /* IDirect3DIndexBuffer9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDevice(LPDIRECT3DINDEXBUFFER9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDevice(IDirect3DIndexBuffer9 *iface, IDirect3DDevice9 **device)
{
IDirect3DIndexBuffer9Impl *This = (IDirect3DIndexBuffer9Impl *)iface; IDirect3DIndexBuffer9Impl *This = (IDirect3DIndexBuffer9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DBuffer_GetDevice(This->wineD3DIndexBuffer, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DIndexBuffer9Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DIndexBuffer9Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
...@@ -79,19 +79,17 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 ifa ...@@ -79,19 +79,17 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 ifa
} }
/* IDirect3DPixelShader9 Interface follow: */ /* IDirect3DPixelShader9 Interface follow: */
static HRESULT WINAPI IDirect3DPixelShader9Impl_GetDevice(LPDIRECT3DPIXELSHADER9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DPixelShader9Impl_GetDevice(IDirect3DPixelShader9 *iface, IDirect3DDevice9 **device)
{
IDirect3DPixelShader9Impl *This = (IDirect3DPixelShader9Impl *)iface; IDirect3DPixelShader9Impl *This = (IDirect3DPixelShader9Impl *)iface;
IWineD3DDevice *myDevice = NULL;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
IWineD3DPixelShader_GetDevice(This->wineD3DPixelShader, &myDevice); IDirect3DDevice9_AddRef(*device);
IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice);
IWineD3DDevice_Release(myDevice); TRACE("Returning device %p.\n", *device);
wined3d_mutex_unlock();
TRACE("(%p) returning (%p)\n", This, *ppDevice);
return D3D_OK; return D3D_OK;
} }
......
...@@ -70,24 +70,18 @@ static ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface) { ...@@ -70,24 +70,18 @@ static ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface) {
} }
/* IDirect3DQuery9 Interface follow: */ /* IDirect3DQuery9 Interface follow: */
static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(LPDIRECT3DQUERY9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(IDirect3DQuery9 *iface, IDirect3DDevice9 **device)
{
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
IWineD3DDevice* pDevice;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DQuery_GetDevice(This->wineD3DQuery, &pDevice); IDirect3DDevice9_AddRef(*device);
if(hr != D3D_OK){
*ppDevice = NULL;
}else{
hr = IWineD3DDevice_GetParent(pDevice, (IUnknown **)ppDevice);
IWineD3DDevice_Release(pDevice);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface) { static D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface) {
......
...@@ -70,23 +70,18 @@ static ULONG WINAPI IDirect3DStateBlock9Impl_Release(LPDIRECT3DSTATEBLOCK9 iface ...@@ -70,23 +70,18 @@ static ULONG WINAPI IDirect3DStateBlock9Impl_Release(LPDIRECT3DSTATEBLOCK9 iface
} }
/* IDirect3DStateBlock9 Interface follow: */ /* IDirect3DStateBlock9 Interface follow: */
static HRESULT WINAPI IDirect3DStateBlock9Impl_GetDevice(LPDIRECT3DSTATEBLOCK9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DStateBlock9Impl_GetDevice(IDirect3DStateBlock9 *iface, IDirect3DDevice9 **device)
{
IDirect3DStateBlock9Impl *This = (IDirect3DStateBlock9Impl *)iface; IDirect3DStateBlock9Impl *This = (IDirect3DStateBlock9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DStateBlock_GetDevice(This->wineD3DStateBlock, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DStateBlock9Impl_Capture(LPDIRECT3DSTATEBLOCK9 iface) { static HRESULT WINAPI IDirect3DStateBlock9Impl_Capture(LPDIRECT3DSTATEBLOCK9 iface) {
......
...@@ -102,23 +102,18 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) { ...@@ -102,23 +102,18 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) {
} }
/* IDirect3DSurface9 IDirect3DResource9 Interface follow: */ /* IDirect3DSurface9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(LPDIRECT3DSURFACE9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DSurface9Impl_GetDevice(IDirect3DSurface9 *iface, IDirect3DDevice9 **device)
{
IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface; IDirect3DSurface9Impl *This = (IDirect3DSurface9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DSurface_GetDevice(This->wineD3DSurface, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DSurface9Impl_SetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DSurface9Impl_SetPrivateData(LPDIRECT3DSURFACE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
...@@ -154,22 +154,18 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN ...@@ -154,22 +154,18 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN
return hr; return hr;
} }
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(IDirect3DSwapChain9 *iface, IDirect3DDevice9 **device)
{
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface; IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DDevice *device = NULL;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hrc = IWineD3DSwapChain_GetDevice(This->wineD3DSwapChain, &device); IDirect3DDevice9_AddRef(*device);
if (hrc == D3D_OK && NULL != device) {
IWineD3DDevice_GetParent(device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(device);
}
wined3d_mutex_unlock();
return hrc; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) { static HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
......
...@@ -82,23 +82,18 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) { ...@@ -82,23 +82,18 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
} }
/* IDirect3DTexture9 IDirect3DResource9 Interface follow: */ /* IDirect3DTexture9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DTexture9Impl_GetDevice(LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DTexture9Impl_GetDevice(IDirect3DTexture9 *iface, IDirect3DDevice9 **device)
{
IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface; IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DTexture_GetDevice(This->wineD3DTexture, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
...@@ -81,23 +81,18 @@ static ULONG WINAPI IDirect3DVertexBuffer9Impl_Release(LPDIRECT3DVERTEXBUFFER9 i ...@@ -81,23 +81,18 @@ static ULONG WINAPI IDirect3DVertexBuffer9Impl_Release(LPDIRECT3DVERTEXBUFFER9 i
} }
/* IDirect3DVertexBuffer9 IDirect3DResource9 Interface follow: */ /* IDirect3DVertexBuffer9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetDevice(LPDIRECT3DVERTEXBUFFER9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DVertexBuffer9Impl_GetDevice(IDirect3DVertexBuffer9 *iface, IDirect3DDevice9 **device)
{
IDirect3DVertexBuffer9Impl *This = (IDirect3DVertexBuffer9Impl *)iface; IDirect3DVertexBuffer9Impl *This = (IDirect3DVertexBuffer9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DBuffer_GetDevice(This->wineD3DVertexBuffer, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DVertexBuffer9Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DVertexBuffer9Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
...@@ -263,22 +263,19 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECL ...@@ -263,22 +263,19 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECL
} }
/* IDirect3DVertexDeclaration9 Interface follow: */ /* IDirect3DVertexDeclaration9 Interface follow: */
static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDevice(LPDIRECT3DVERTEXDECLARATION9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDevice(IDirect3DVertexDeclaration9 *iface,
IDirect3DDevice9 **device)
{
IDirect3DVertexDeclaration9Impl *This = (IDirect3DVertexDeclaration9Impl *)iface; IDirect3DVertexDeclaration9Impl *This = (IDirect3DVertexDeclaration9Impl *)iface;
IWineD3DDevice *myDevice = NULL;
HRESULT hr = D3D_OK;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DVertexDeclaration_GetDevice(This->wineD3DVertexDeclaration, &myDevice); IDirect3DDevice9_AddRef(*device);
if (hr == D3D_OK && myDevice != NULL) {
hr = IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice);
IWineD3DDevice_Release(myDevice);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDeclaration(LPDIRECT3DVERTEXDECLARATION9 iface, D3DVERTEXELEMENT9* pDecl, UINT* pNumElements) { static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDeclaration(LPDIRECT3DVERTEXDECLARATION9 iface, D3DVERTEXELEMENT9* pDecl, UINT* pNumElements) {
......
...@@ -79,25 +79,18 @@ static ULONG WINAPI IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 i ...@@ -79,25 +79,18 @@ static ULONG WINAPI IDirect3DVertexShader9Impl_Release(LPDIRECT3DVERTEXSHADER9 i
} }
/* IDirect3DVertexShader9 Interface follow: */ /* IDirect3DVertexShader9 Interface follow: */
static HRESULT WINAPI IDirect3DVertexShader9Impl_GetDevice(LPDIRECT3DVERTEXSHADER9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DVertexShader9Impl_GetDevice(IDirect3DVertexShader9 *iface, IDirect3DDevice9 **device)
{
IDirect3DVertexShader9Impl *This = (IDirect3DVertexShader9Impl *)iface; IDirect3DVertexShader9Impl *This = (IDirect3DVertexShader9Impl *)iface;
IWineD3DDevice *myDevice = NULL;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DVertexShader_GetDevice(This->wineD3DVertexShader, &myDevice); IDirect3DDevice9_AddRef(*device);
if (WINED3D_OK == hr && myDevice != NULL) {
hr = IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice);
IWineD3DDevice_Release(myDevice);
} else {
*ppDevice = NULL;
}
wined3d_mutex_unlock();
TRACE("(%p) returning (%p)\n", This, *ppDevice); TRACE("Returning device %p.\n", *device);
return hr;
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DVertexShader9Impl_GetFunction(LPDIRECT3DVERTEXSHADER9 iface, VOID* pData, UINT* pSizeOfData) { static HRESULT WINAPI IDirect3DVertexShader9Impl_GetFunction(LPDIRECT3DVERTEXSHADER9 iface, VOID* pData, UINT* pSizeOfData) {
......
...@@ -81,23 +81,18 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9 ...@@ -81,23 +81,18 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9
} }
/* IDirect3DVolumeTexture9 IDirect3DResource9 Interface follow: */ /* IDirect3DVolumeTexture9 IDirect3DResource9 Interface follow: */
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE9 iface, IDirect3DDevice9** ppDevice) { static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetDevice(IDirect3DVolumeTexture9 *iface, IDirect3DDevice9 **device)
{
IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface;
IWineD3DDevice *wined3d_device;
HRESULT hr;
TRACE("iface %p, device %p.\n", iface, ppDevice); TRACE("iface %p, device %p.\n", iface, device);
wined3d_mutex_lock(); *device = (IDirect3DDevice9 *)This->parentDevice;
hr = IWineD3DStateBlock_GetDevice(This->wineD3DVolumeTexture, &wined3d_device); IDirect3DDevice9_AddRef(*device);
if (SUCCEEDED(hr))
{
IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
IWineD3DDevice_Release(wined3d_device);
}
wined3d_mutex_unlock();
return hr; TRACE("Returning device %p.\n", *device);
return D3D_OK;
} }
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { static HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment