Commit 99e5e3ac authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Refuse to set a clip list if a clipper is already tracking a window.

parent 39974575
...@@ -180,8 +180,13 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT ...@@ -180,8 +180,13 @@ static HRESULT WINAPI ddraw_clipper_GetClipList(IDirectDrawClipper *iface, RECT
*****************************************************************************/ *****************************************************************************/
static HRESULT WINAPI ddraw_clipper_SetClipList(IDirectDrawClipper *iface, RGNDATA *region, DWORD flags) static HRESULT WINAPI ddraw_clipper_SetClipList(IDirectDrawClipper *iface, RGNDATA *region, DWORD flags)
{ {
struct ddraw_clipper *clipper = impl_from_IDirectDrawClipper(iface);
FIXME("iface %p, region %p, flags %#x stub!\n", iface, region, flags); FIXME("iface %p, region %p, flags %#x stub!\n", iface, region, flags);
if (clipper->window)
return DDERR_CLIPPERISUSINGHWND;
return DD_OK; return DD_OK;
} }
......
...@@ -248,7 +248,7 @@ static void test_clipper_blt(void) ...@@ -248,7 +248,7 @@ static void test_clipper_blt(void)
DeleteObject(r1); DeleteObject(r1);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
todo_wine ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL);
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
......
...@@ -255,7 +255,7 @@ static void test_clipper_blt(void) ...@@ -255,7 +255,7 @@ static void test_clipper_blt(void)
DeleteObject(r1); DeleteObject(r1);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
todo_wine ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL);
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
......
...@@ -550,7 +550,7 @@ static void test_clipper_blt(void) ...@@ -550,7 +550,7 @@ static void test_clipper_blt(void)
DeleteObject(r1); DeleteObject(r1);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
todo_wine ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL);
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
......
...@@ -543,7 +543,7 @@ static void test_clipper_blt(void) ...@@ -543,7 +543,7 @@ static void test_clipper_blt(void)
DeleteObject(r1); DeleteObject(r1);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
todo_wine ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_CLIPPERISUSINGHWND, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL); hr = IDirectDrawClipper_SetHWnd(clipper, 0, NULL);
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0); hr = IDirectDrawClipper_SetClipList(clipper, rgn_data, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment