d3d9: Allow passing "mode" to IDirect3DDevice9Ex_ResetEx() iff "Windowed" is FALSE.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-08-22 14:53:49 +02:00 committed by Alexandre Julliard
parent de3ca49952
commit c1cc6e45da
2 changed files with 10 additions and 4 deletions

View file

@ -3449,6 +3449,12 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *
TRACE("iface %p, present_parameters %p, mode %p.\n", iface, present_parameters, mode);
if (!present_parameters->Windowed == !mode)
{
WARN("Mode can be passed if and only if Windowed is FALSE.\n");
return D3DERR_INVALIDCALL;
}
return d3d9_device_reset(device, present_parameters, mode);
}

View file

@ -1465,7 +1465,7 @@ static void test_reset_ex(void)
modes[i].RefreshRate = 0;
modes[i].ScanLineOrdering = 0;
hr = IDirect3DDevice9Ex_ResetEx(device, &d3dpp, NULL);
todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_ResetEx(device, &d3dpp, &modes[i]);
ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_TestCooperativeLevel(device);
@ -1665,7 +1665,7 @@ static void test_reset_ex(void)
d3dpp.BackBufferHeight = 400;
d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8;
hr = IDirect3DDevice9Ex_ResetEx(device, &d3dpp, &mode);
todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_ResetEx(device, &d3dpp, NULL);
ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_TestCooperativeLevel(device);
@ -1673,8 +1673,8 @@ static void test_reset_ex(void)
width = GetSystemMetrics(SM_CXSCREEN);
height = GetSystemMetrics(SM_CYSCREEN);
todo_wine ok(width == modes[1].Width, "Screen width is %u, expected %u.\n", width, modes[1].Width);
todo_wine ok(height == modes[1].Height, "Screen height is %u, expected %u.\n", height, modes[1].Height);
ok(width == modes[1].Width, "Screen width is %u, expected %u.\n", width, modes[1].Width);
ok(height == modes[1].Height, "Screen height is %u, expected %u.\n", height, modes[1].Height);
hr = IDirect3DDevice9Ex_GetScissorRect(device, &rect);
ok(SUCCEEDED(hr), "Failed to get scissor rect, hr %#x.\n", hr);