ddraw: DDSCL_CREATEDEVICEWINDOW requires DDSCL_EXCLUSIVE.

This commit is contained in:
Henri Verbeet 2011-12-22 21:51:18 +01:00 committed by Alexandre Julliard
parent 4333b7d370
commit 2ec0c7bfdc
5 changed files with 15 additions and 8 deletions

View File

@ -787,6 +787,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
} }
if ((cooplevel & DDSCL_CREATEDEVICEWINDOW) && !(cooplevel & DDSCL_EXCLUSIVE))
{
WARN("DDSCL_CREATEDEVICEWINDOW requires DDSCL_EXCLUSIVE.\n");
wined3d_mutex_unlock();
return DDERR_INVALIDPARAMS;
}
/* Handle those levels first which set various hwnds */ /* Handle those levels first which set various hwnds */
if(cooplevel & DDSCL_SETFOCUSWINDOW) if(cooplevel & DDSCL_SETFOCUSWINDOW)
{ {

View File

@ -53,11 +53,11 @@ static void test_coop_level_create_device_window(void)
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);

View File

@ -60,11 +60,11 @@ static void test_coop_level_create_device_window(void)
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);

View File

@ -356,11 +356,11 @@ static void test_coop_level_create_device_window(void)
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN); hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);

View File

@ -349,11 +349,11 @@ static void test_coop_level_create_device_window(void)
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN); hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL | DDSCL_FULLSCREEN);
todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd"); device_window = FindWindowA("DirectDrawDeviceWnd", "DirectDrawDeviceWnd");
ok(!device_window, "Unexpected device window found.\n"); ok(!device_window, "Unexpected device window found.\n");
hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);