forked from Mirrors/wine-wine
ddraw/tests: Test restoring attached surface for ddraw2.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit d8812edc65
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
parent
6b1406e11f
commit
dfa69cd6e3
|
@ -8005,11 +8005,12 @@ static void test_palette_alpha(void)
|
||||||
|
|
||||||
static void test_lost_device(void)
|
static void test_lost_device(void)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface *surface;
|
IDirectDrawSurface *surface, *back_buffer;
|
||||||
DDSURFACEDESC surface_desc;
|
DDSURFACEDESC surface_desc;
|
||||||
HWND window1, window2;
|
HWND window1, window2;
|
||||||
IDirectDraw2 *ddraw;
|
IDirectDraw2 *ddraw;
|
||||||
ULONG refcount;
|
ULONG refcount;
|
||||||
|
DDSCAPS caps;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
@ -8147,6 +8148,19 @@ static void test_lost_device(void)
|
||||||
hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT);
|
hr = IDirectDrawSurface_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 = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||||
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface_Restore(surface);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
hr = IDirectDrawSurface_IsLost(back_buffer);
|
||||||
|
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||||
|
IDirectDrawSurface_Release(back_buffer);
|
||||||
|
|
||||||
IDirectDrawSurface_Release(surface);
|
IDirectDrawSurface_Release(surface);
|
||||||
refcount = IDirectDraw2_Release(ddraw);
|
refcount = IDirectDraw2_Release(ddraw);
|
||||||
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
ok(!refcount, "Got unexpected refcount %u.\n", refcount);
|
||||||
|
|
Loading…
Reference in New Issue