diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 474aad86230..4a7066c6f77 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -154,21 +154,21 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DV TRACE("(%p) Relay\n", This); - /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format; - wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; - wined3ddesc.Usage = &pDesc->Usage; - wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; - wined3ddesc.Size = &pDesc->Size; - wined3ddesc.Width = &pDesc->Width; - wined3ddesc.Height = &pDesc->Height; - wined3ddesc.Depth = &pDesc->Depth; - EnterCriticalSection(&d3d8_cs); hr = IWineD3DVolume_GetDesc(This->wineD3DVolume, &wined3ddesc); LeaveCriticalSection(&d3d8_cs); - if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(pDesc->Format); + if (SUCCEEDED(hr)) + { + pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); + pDesc->Type = wined3ddesc.Type; + pDesc->Usage = wined3ddesc.Usage; + pDesc->Pool = wined3ddesc.Pool; + pDesc->Size = wined3ddesc.Size; + pDesc->Width = wined3ddesc.Width; + pDesc->Height = wined3ddesc.Height; + pDesc->Depth = wined3ddesc.Depth; + } return hr; } diff --git a/dlls/d3d8/volumetexture.c b/dlls/d3d8/volumetexture.c index 098827aedd8..25aa93dc698 100644 --- a/dlls/d3d8/volumetexture.c +++ b/dlls/d3d8/volumetexture.c @@ -197,26 +197,25 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETE static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC* pDesc) { IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface; WINED3DVOLUME_DESC wined3ddesc; - UINT tmpInt = -1; HRESULT hr; TRACE("(%p) Relay\n", This); - /* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format; - wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; - wined3ddesc.Usage = &pDesc->Usage; - wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; - wined3ddesc.Size = &tmpInt; - wined3ddesc.Width = &pDesc->Width; - wined3ddesc.Height = &pDesc->Height; - wined3ddesc.Depth = &pDesc->Depth; - EnterCriticalSection(&d3d8_cs); hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, Level, &wined3ddesc); LeaveCriticalSection(&d3d8_cs); - if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(pDesc->Format); + if (SUCCEEDED(hr)) + { + pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); + pDesc->Type = wined3ddesc.Type; + pDesc->Usage = wined3ddesc.Usage; + pDesc->Pool = wined3ddesc.Pool; + pDesc->Size = wined3ddesc.Size; + pDesc->Width = wined3ddesc.Width; + pDesc->Height = wined3ddesc.Height; + pDesc->Depth = wined3ddesc.Depth; + } return hr; } diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 8f95ad11114..c711087d517 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -454,15 +454,8 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data break; case D3DRTYPE_VOLUME: - volume_desc.Format = &dummy_format; - volume_desc.Type = &type; - volume_desc.Usage = &dummy_dword; - volume_desc.Pool = &pool; - volume_desc.Size = &dummy_dword; - volume_desc.Width = &dummy_dword; - volume_desc.Height = &dummy_dword; - volume_desc.Depth = &dummy_dword; IWineD3DVolume_GetDesc((IWineD3DVolume *) resource, &volume_desc); + pool = volume_desc.Pool; break; case D3DRTYPE_INDEXBUFFER: diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c index 93b06b53158..7c49a9aaad2 100644 --- a/dlls/d3d9/volume.c +++ b/dlls/d3d9/volume.c @@ -167,29 +167,26 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, static HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc) { IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface; WINED3DVOLUME_DESC wined3ddesc; - UINT tmpInt = -1; - WINED3DFORMAT format; HRESULT hr; TRACE("(%p) Relay\n", This); - /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = &format; - wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; - wined3ddesc.Usage = &pDesc->Usage; - wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; - wined3ddesc.Size = &tmpInt; - wined3ddesc.Width = &pDesc->Width; - wined3ddesc.Height = &pDesc->Height; - wined3ddesc.Depth = &pDesc->Depth; - EnterCriticalSection(&d3d9_cs); hr = IWineD3DVolume_GetDesc(This->wineD3DVolume, &wined3ddesc); LeaveCriticalSection(&d3d9_cs); - if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); + if (SUCCEEDED(hr)) + { + pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); + pDesc->Type = wined3ddesc.Type; + pDesc->Usage = wined3ddesc.Usage; + pDesc->Pool = wined3ddesc.Pool; + pDesc->Width = wined3ddesc.Width; + pDesc->Height = wined3ddesc.Height; + pDesc->Depth = wined3ddesc.Depth; + } return hr; } diff --git a/dlls/d3d9/volumetexture.c b/dlls/d3d9/volumetexture.c index 07b686fe5a4..efeb919b57c 100644 --- a/dlls/d3d9/volumetexture.c +++ b/dlls/d3d9/volumetexture.c @@ -281,29 +281,26 @@ static void WINAPI IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVO static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DVOLUME_DESC* pDesc) { IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; WINED3DVOLUME_DESC wined3ddesc; - UINT tmpInt = -1; - WINED3DFORMAT format; HRESULT hr; TRACE("(%p) Relay\n", This); - /* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */ - wined3ddesc.Format = &format; - wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type; - wined3ddesc.Usage = &pDesc->Usage; - wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool; - wined3ddesc.Size = &tmpInt; - wined3ddesc.Width = &pDesc->Width; - wined3ddesc.Height = &pDesc->Height; - wined3ddesc.Depth = &pDesc->Depth; - EnterCriticalSection(&d3d9_cs); hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, Level, &wined3ddesc); LeaveCriticalSection(&d3d9_cs); - if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format); + if (SUCCEEDED(hr)) + { + pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format); + pDesc->Type = wined3ddesc.Type; + pDesc->Usage = wined3ddesc.Usage; + pDesc->Pool = wined3ddesc.Pool; + pDesc->Width = wined3ddesc.Width; + pDesc->Height = wined3ddesc.Height; + pDesc->Depth = wined3ddesc.Depth; + } return hr; } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 64d871b83ec..829607d2fba 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -196,14 +196,15 @@ static HRESULT WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DV IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; TRACE("(%p) : copying into %p\n", This, pDesc); - *(pDesc->Format) = This->resource.format_desc->format; - *(pDesc->Type) = This->resource.resourceType; - *(pDesc->Usage) = This->resource.usage; - *(pDesc->Pool) = This->resource.pool; - *(pDesc->Size) = This->resource.size; /* dx8 only */ - *(pDesc->Width) = This->currentDesc.Width; - *(pDesc->Height) = This->currentDesc.Height; - *(pDesc->Depth) = This->currentDesc.Depth; + pDesc->Format = This->resource.format_desc->format; + pDesc->Type = This->resource.resourceType; + pDesc->Usage = This->resource.usage; + pDesc->Pool = This->resource.pool; + pDesc->Size = This->resource.size; /* dx8 only */ + pDesc->Width = This->currentDesc.Width; + pDesc->Height = This->currentDesc.Height; + pDesc->Depth = This->currentDesc.Depth; + return WINED3D_OK; } diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index 51d886c85c6..4a7dcb05e69 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -1737,14 +1737,14 @@ typedef struct _WINED3DSURFACE_DESC typedef struct _WINED3DVOLUME_DESC { - WINED3DFORMAT *Format; - WINED3DRESOURCETYPE *Type; - DWORD *Usage; - WINED3DPOOL *Pool; - UINT *Size; - UINT *Width; - UINT *Height; - UINT *Depth; + WINED3DFORMAT Format; + WINED3DRESOURCETYPE Type; + DWORD Usage; + WINED3DPOOL Pool; + UINT Size; + UINT Width; + UINT Height; + UINT Depth; } WINED3DVOLUME_DESC; typedef struct _WINED3DCLIPSTATUS