From: "Stefan Dösinger" Subject: [PATCH 2/3] ddraw: Thunk to surface1, not surface7 in surface_unlock. Message-Id: <20200618173225.155040-2-stefan@codeweavers.com> Date: Thu, 18 Jun 2020 19:32:24 +0200 In-Reply-To: <20200618173225.155040-1-stefan@codeweavers.com> References: <20200618173225.155040-1-stefan@codeweavers.com> Signed-off-by: Stefan Dösinger --- dlls/ddraw/surface.c | 49 +++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 46c5fa7da0f..d4435378ddd 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1198,24 +1198,12 @@ static HRESULT WINAPI ddraw_surface1_Lock(IDirectDrawSurface *iface, RECT *rect, return ddraw_surface_lock_ddsd(surface, rect, surface_desc, flags, h); } -/***************************************************************************** - * IDirectDrawSurface7::Unlock - * - * Unlocks an locked surface - * - * Params: - * Rect: Not used by this implementation - * - * Returns: - * D3D_OK on success, error code otherwise. - * - *****************************************************************************/ -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface7 *iface, RECT *pRect) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface1_Unlock(IDirectDrawSurface *iface, void *data) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface(iface); HRESULT hr; - TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); + TRACE("iface %p, data %p.\n", iface, data); wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); @@ -1226,43 +1214,40 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface return hr; } -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface4_Unlock(IDirectDrawSurface4 *iface, RECT *pRect) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface7 *iface, RECT *rect) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface4(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - TRACE("iface %p, rect %p.\n", iface, pRect); + TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(rect)); - return ddraw_surface7_Unlock(&surface->IDirectDrawSurface7_iface, pRect); + return ddraw_surface1_Unlock(&surface->IDirectDrawSurface_iface, NULL); } -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface3_Unlock(IDirectDrawSurface3 *iface, void *data) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface4_Unlock(IDirectDrawSurface4 *iface, RECT *rect) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface3(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface4(iface); - TRACE("iface %p, data %p.\n", iface, data); + TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(rect)); - /* data might not be the LPRECT of later versions, so drop it. */ - return ddraw_surface7_Unlock(&surface->IDirectDrawSurface7_iface, NULL); + return ddraw_surface1_Unlock(&surface->IDirectDrawSurface_iface, NULL); } -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface2_Unlock(IDirectDrawSurface2 *iface, void *data) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface3_Unlock(IDirectDrawSurface3 *iface, void *data) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface2(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface3(iface); TRACE("iface %p, data %p.\n", iface, data); - /* data might not be the LPRECT of later versions, so drop it. */ - return ddraw_surface7_Unlock(&surface->IDirectDrawSurface7_iface, NULL); + return ddraw_surface1_Unlock(&surface->IDirectDrawSurface_iface, data); } -static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface1_Unlock(IDirectDrawSurface *iface, void *data) +static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface2_Unlock(IDirectDrawSurface2 *iface, void *data) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface2(iface); TRACE("iface %p, data %p.\n", iface, data); - /* data might not be the LPRECT of later versions, so drop it. */ - return ddraw_surface7_Unlock(&surface->IDirectDrawSurface7_iface, NULL); + return ddraw_surface1_Unlock(&surface->IDirectDrawSurface_iface, data); } static unsigned int ddraw_swap_interval_from_flags(DWORD flags) -- 2.26.2