-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Am 2016-03-27 um 13:05 schrieb David Adam:
Signed-off-by: David Adam david.adam.cnrs@gmail.com
dlls/d3d8/surface.c | 9 ++++----- dlls/d3d8/tests/visual.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 565f642..376bc6f 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -271,11 +271,10 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface) hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); wined3d_mutex_unlock();
- switch(hr)
- {
case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL;
default: return hr;
- }
- if (hr == WINEDDERR_NOTLOCKED)
return D3D_OK;
I suspect that similarly to lock validation the behavior of double unlocks depends on the resource type (surface vs texture).
@@ -178,6 +178,8 @@ static D3DCOLOR get_surface_color(IDirect3DSurface8 *surface, UINT x, UINT y)
hr = IDirect3DSurface8_UnlockRect(surface); ok(SUCCEEDED(hr), "Failed to unlock surface, hr=%#x.\n", hr);
- hr = IDirect3DSurface8_UnlockRect(surface);
- ok(SUCCEEDED(hr), "Failed to double unlock surface, hr=%#x.\n", hr);
We have test_surface_double_unlock() in device.c and test_lockrect_invalid(). The test fits there better than sprinkled all around visual.c. (I have a preference for merging test_surface_double_unlock into test_lockrect_invalid, but I haven't looked closely how well that'll work)