Commit c1cc6e45 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

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

parent de3ca499
......@@ -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);
}
......
......@@ -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);
......
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