From: Conor McCarthy <cmccarthy@codeweavers.com> --- dlls/d3d8/surface.c | 11 +++++++++++ dlls/d3d8/tests/device.c | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 5b02035d539..23a1a4b14eb 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -210,10 +210,21 @@ static HRESULT WINAPI d3d8_surface_LockRect(IDirect3DSurface8 *iface, struct wined3d_map_desc map_desc; HRESULT hr; D3DRESOURCETYPE type; + D3DSURFACE_DESC desc; TRACE("iface %p, locked_rect %p, rect %s, flags %#lx.\n", iface, locked_rect, wine_dbgstr_rect(rect), flags); + IDirect3DSurface8_GetDesc(iface, &desc); + + if (desc.MultiSampleType) + { + WARN("Trying to lock a multisampled surface, returning D3DERR_INVALIDCALL.\n"); + locked_rect->Pitch = 0; + locked_rect->pBits = NULL; + return D3DERR_INVALIDCALL; + } + wined3d_mutex_lock(); if (surface->texture) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index ff14cac9dec..019340b191e 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -9594,10 +9594,7 @@ static void test_swapchain_multisample_reset(void) /* But locking is not allowed. */ hr = IDirect3DSurface8_LockRect(surface, &lr, NULL, 0); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - IDirect3DSurface8_UnlockRect(surface); IDirect3DSurface8_Release(surface); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10874