Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- Supersede 178301
dlls/dxgi/adapter.c | 3 +++ dlls/dxgi/factory.c | 3 +++ dlls/dxgi/tests/dxgi.c | 10 ++++++++++ 3 files changed, 16 insertions(+)
diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index d2fc629c84..7cdf7bd0d6 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -128,6 +128,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output);
+ if (!output) + return E_INVALIDARG; + if (output_idx > 0) { *output = NULL; diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index a0038b4fe7..3f41df9e36 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -403,6 +403,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapterByLuid(IWineDXGIFactory TRACE("iface %p, luid %08x:%08x, iid %s, adapter %p.\n", iface, luid.HighPart, luid.LowPart, debugstr_guid(iid), adapter);
+ if (!adapter) + return DXGI_ERROR_INVALID_CALL; + adapter_index = 0; while ((hr = dxgi_factory_EnumAdapters1(iface, adapter_index, &adapter1)) == S_OK) { diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index f8e63ea25e..e2b5df7b27 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -912,6 +912,10 @@ static void test_adapter_luid(void) return; }
+ hr = IDXGIFactory4_EnumAdapterByLuid(factory4, device_adapter_desc.AdapterLuid, + &IID_IDXGIAdapter, NULL); + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + hr = IDXGIFactory4_EnumAdapterByLuid(factory4, device_adapter_desc.AdapterLuid, &IID_IDXGIAdapter, (void **)&adapter); todo_wine ok(hr == S_OK, "Failed to enum adapter by LUID, hr %#x.\n", hr); @@ -1171,6 +1175,9 @@ static void test_output(void) hr = IDXGIDevice_GetAdapter(device, &adapter); ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr);
+ hr = IDXGIAdapter_EnumOutputs(adapter, 0, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter_EnumOutputs(adapter, 0, &output); if (hr == DXGI_ERROR_NOT_FOUND) { @@ -4949,6 +4956,9 @@ static void test_multi_adapter(void) return; }
+ hr = IDXGIFactory_EnumAdapters(factory, 0, NULL); + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); if (hr == DXGI_ERROR_NOT_FOUND) {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65357
Your paranoid android.
=== w1064v1809_2scr (32 bit report) ===
dxgi: dxgi.c:2237: Test failed: Got window rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2237: Test failed: Got client rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2237: Test failed: Got monitor rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2241: Test failed: Got window rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2241: Test failed: Got client rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2241: Test failed: Got monitor rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2298: Test failed: Got window rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2298: Test failed: Got client rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2298: Test failed: Got monitor rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2312: Test failed: Got window rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2312: Test failed: Got client rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2312: Test failed: Got monitor rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2315: Test failed: Got window rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2315: Test failed: Got client rect (0,0)-(1024,768), expected (0,0)-(800,600). dxgi.c:2315: Test failed: Got monitor rect (0,0)-(1024,768), expected (0,0)-(800,600).
On Tue, 18 Feb 2020 at 05:33, Zhiyi Zhang zzhang@codeweavers.com wrote:
diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index d2fc629c84..7cdf7bd0d6 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -128,6 +128,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
TRACE("iface %p, output_idx %u, output %p.\n", iface, output_idx, output);
- if (!output)
return E_INVALIDARG;
- if (output_idx > 0) { *output = NULL;
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index a0038b4fe7..3f41df9e36 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -403,6 +403,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapterByLuid(IWineDXGIFactory TRACE("iface %p, luid %08x:%08x, iid %s, adapter %p.\n", iface, luid.HighPart, luid.LowPart, debugstr_guid(iid), adapter);
- if (!adapter)
return DXGI_ERROR_INVALID_CALL;
- adapter_index = 0; while ((hr = dxgi_factory_EnumAdapters1(iface, adapter_index, &adapter1)) == S_OK) {
This patch does two different things, please split.