[PATCH 5/5] ddraw: Return the correct error in ddraw_surface7_Flip() when the surface is not flippable.
Henri Verbeet
hverbeet at codeweavers.com
Tue Dec 3 02:59:19 CST 2013
---
dlls/ddraw/surface.c | 4 +---
dlls/ddraw/tests/ddraw1.c | 6 +++---
dlls/ddraw/tests/ddraw2.c | 6 +++---
dlls/ddraw/tests/ddraw4.c | 6 +++---
dlls/ddraw/tests/ddraw7.c | 6 +++---
5 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 980b83a..8403a32 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -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();
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 7dac193..2d62ec6 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index c70b98c..bb07bea 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index dc9a282..376d80e 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 743c4a2..400a8bc 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -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);
--
1.7.10.4
More information about the wine-patches
mailing list