ddraw: Return the correct error in ddraw_surface7_Flip() when the surface is not flippable.

This commit is contained in:
Henri Verbeet 2013-12-03 09:59:19 +01:00 committed by Alexandre Julliard
parent 66c71baefe
commit e780ee581d
5 changed files with 13 additions and 15 deletions

View File

@ -1197,10 +1197,8 @@ static HRESULT WINAPI ddraw_surface7_Flip(IDirectDrawSurface7 *iface, IDirectDra
TRACE("iface %p, dst %p, flags %#x.\n", iface, DestOverride, Flags);
/* Flip has to be called from a front buffer
* What about overlay surfaces, AFAIK they can flip too? */
if (!(surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY)))
return DDERR_INVALIDOBJECT; /* Unchecked */
return DDERR_NOTFLIPPABLE;
wined3d_mutex_lock();

View File

@ -3625,11 +3625,11 @@ static void test_flip(void)
hr = IDirectDrawSurface_Flip(primary, primary, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer1, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer2, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer3, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);

View File

@ -4306,11 +4306,11 @@ static void test_flip(void)
hr = IDirectDrawSurface_Flip(primary, primary, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer1, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer2, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_Flip(backbuffer3, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);

View File

@ -4910,11 +4910,11 @@ static void test_flip(void)
hr = IDirectDrawSurface4_Flip(primary, primary, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_Flip(backbuffer1, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_Flip(backbuffer2, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_Flip(backbuffer3, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);

View File

@ -4797,11 +4797,11 @@ static void test_flip(void)
hr = IDirectDrawSurface7_Flip(primary, primary, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Flip(backbuffer1, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Flip(backbuffer2, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_Flip(backbuffer3, NULL, DDFLIP_WAIT);
todo_wine ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
ok(hr == DDERR_NOTFLIPPABLE, "Got unexpected hr %#x.\n", hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);