=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d9: Allow passing "mode" to IDirect3DDevice9Ex_ResetEx() iff "Windowed" is FALSE.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 12:05:17 CDT 2016


Module: wine
Branch: master
Commit: c1cc6e45dabbc695cc7b863d1750822c9598a5b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c1cc6e45dabbc695cc7b863d1750822c9598a5b7

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Aug 22 14:53:49 2016 +0200

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

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d9/device.c       | 6 ++++++
 dlls/d3d9/tests/d3d9ex.c | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 1c600ca..097b05f 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -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);
 }
 
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index c857e53..63e9a30 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -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);




More information about the wine-cvs mailing list