diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index 67ef56662d4..57d355a98db 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -210,16 +210,15 @@ static HRESULT WINAPI d3d9_swapchain_GetPresentParameters(IDirect3DSwapChain9 *i { struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9(iface); struct wined3d_swapchain_desc desc; - HRESULT hr; TRACE("iface %p, parameters %p.\n", iface, parameters); wined3d_mutex_lock(); - hr = wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &desc); + wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &desc); wined3d_mutex_unlock(); present_parameters_from_wined3d_swapchain_desc(parameters, &desc); - return hr; + return D3D_OK; } diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index e83091eed0b..e7d9302da4f 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2900,13 +2900,7 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD, { struct wined3d_swapchain_desc swapchain_desc; - hr = wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc); - if (FAILED(hr)) - { - ERR("Failed to get present parameters.\n"); - return hr; - } - + wined3d_swapchain_get_desc(ddraw->wined3d_swapchain, &swapchain_desc); swapchain_desc.backbuffer_width = mode.width; swapchain_desc.backbuffer_height = mode.height; swapchain_desc.backbuffer_format = mode.format_id; diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index fc6f0a06c12..65b89c29a0c 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -192,7 +192,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D { struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); struct wined3d_swapchain_desc wined3d_desc; - HRESULT hr; FIXME("iface %p, desc %p partial stub!\n", iface, desc); @@ -200,14 +199,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D return E_INVALIDARG; EnterCriticalSection(&dxgi_cs); - - hr = wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); - if (FAILED(hr)) - { - LeaveCriticalSection(&dxgi_cs); - return hr; - } - + wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); LeaveCriticalSection(&dxgi_cs); FIXME("Ignoring ScanlineOrdering, Scaling, SwapEffect and Flags\n"); @@ -227,7 +219,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDesc(IDXGISwapChain *iface, D desc->SwapEffect = DXGI_SWAP_EFFECT_DISCARD; desc->Flags = 0; - return hr; + return S_OK; } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *iface, diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 1125cc62cb1..2fa221aeff8 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -244,14 +244,12 @@ struct wined3d_device * CDECL wined3d_swapchain_get_device(const struct wined3d_ return swapchain->device; } -HRESULT CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, +void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc) { TRACE("swapchain %p, desc %p.\n", swapchain, desc); *desc = swapchain->desc; - - return WINED3D_OK; } HRESULT CDECL wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2b277ca1f10..521b2b3d41a 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2369,7 +2369,7 @@ HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swa HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain, struct wined3d_gamma_ramp *ramp); void * __cdecl wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain); -HRESULT __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, +void __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc); HRESULT __cdecl wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain, struct wined3d_raster_status *raster_status);