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

This commit is contained in:
Henri Verbeet 2012-01-04 23:34:53 +01:00 committed by Alexandre Julliard
parent 3997457574
commit 99e5e3ac0d
5 changed files with 9 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);