[02/02] d3d8: update locked_rect only if wined3d_surface_map succeeds

Henri Verbeet hverbeet at gmail.com
Mon Oct 21 06:46:08 CDT 2013


On 21 October 2013 10:47, Lasse Rasinen <lrasinen at iki.fi> wrote:
> diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
> index 7932a7f..52cf27a 100644
> --- a/dlls/d3d8/tests/device.c
> +++ b/dlls/d3d8/tests/device.c
> @@ -4022,8 +4022,12 @@ static void test_lockrect_invalid(void)
>
>      hr = IDirect3DSurface8_LockRect(surface, &locked_rect, NULL, 0);
>      ok(SUCCEEDED(hr), "Failed to lock surface with rect NULL, hr %#x.\n", hr);
> +    locked_rect.pBits = 0xdeadbeef;
> +    locked_rect.Pitch = 1;
>      hr = IDirect3DSurface8_LockRect(surface, &locked_rect, NULL, 0);
>      ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
> +    ok(locked_rect.pBits == 0xdeadbeef, "pBits changed on double lock.\n");
> +    ok(locked_rect.Pitch == 1, "Pitch changed on double lock.\n");
>      hr = IDirect3DSurface8_UnlockRect(surface);
>      ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
>
This test fails for me on Windows 7:

device.c:4029: Test failed: pBits changed on double lock.
device.c:4030: Test failed: Pitch changed on double lock.

As an aside, if you had written the messages as "Got unexpected pBits
%p.\n" and "Got unexpected Pitch %d.\n", you would have gotten the
following output instead:

device.c:4029: Test failed: Got unexpected pBits 00000000.
device.c:4030: Test failed: Got unexpected Pitch 0.



More information about the wine-devel mailing list