ddraw/tests: Test restoring attached surface for ddraw4.
Signed-off-by: Paul Gofman <gofmanp@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5c9a7b0986
commit
da2fdc4cd3
|
@ -9255,11 +9255,12 @@ static void test_vb_writeonly(void)
|
||||||
|
|
||||||
static void test_lost_device(void)
|
static void test_lost_device(void)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface4 *surface;
|
IDirectDrawSurface4 *surface, *back_buffer;
|
||||||
DDSURFACEDESC2 surface_desc;
|
DDSURFACEDESC2 surface_desc;
|
||||||
HWND window1, window2;
|
HWND window1, window2;
|
||||||
IDirectDraw4 *ddraw;
|
IDirectDraw4 *ddraw;
|
||||||
ULONG refcount;
|
ULONG refcount;
|
||||||
|
DDSCAPS2 caps;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
@ -9426,9 +9427,23 @@ static void test_lost_device(void)
|
||||||
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface4_IsLost(surface);
|
hr = IDirectDrawSurface4_IsLost(surface);
|
||||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT);
|
hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT);
|
||||||
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
memset(&caps, 0, sizeof(caps));
|
||||||
|
caps.dwCaps = DDSCAPS_FLIP;
|
||||||
|
|
||||||
|
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||||
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface4_Restore(surface);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface4_IsLost(back_buffer);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
IDirectDrawSurface4_Release(back_buffer);
|
||||||
|
|
||||||
IDirectDrawSurface4_Release(surface);
|
IDirectDrawSurface4_Release(surface);
|
||||||
refcount = IDirectDraw4_Release(ddraw);
|
refcount = IDirectDraw4_Release(ddraw);
|
||||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||||
|
|
Loading…
Reference in New Issue