dxgi: Check NULL adapter parameter in dxgi_factory_EnumAdapterByLuid().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
eaacf86d6b
commit
23a8887ded
|
@ -403,6 +403,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapterByLuid(IWineDXGIFactory
|
||||||
TRACE("iface %p, luid %08x:%08x, iid %s, adapter %p.\n",
|
TRACE("iface %p, luid %08x:%08x, iid %s, adapter %p.\n",
|
||||||
iface, luid.HighPart, luid.LowPart, debugstr_guid(iid), adapter);
|
iface, luid.HighPart, luid.LowPart, debugstr_guid(iid), adapter);
|
||||||
|
|
||||||
|
if (!adapter)
|
||||||
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
adapter_index = 0;
|
adapter_index = 0;
|
||||||
while ((hr = dxgi_factory_EnumAdapters1(iface, adapter_index, &adapter1)) == S_OK)
|
while ((hr = dxgi_factory_EnumAdapters1(iface, adapter_index, &adapter1)) == S_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -912,6 +912,10 @@ static void test_adapter_luid(void)
|
||||||
return;
|
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,
|
hr = IDXGIFactory4_EnumAdapterByLuid(factory4, device_adapter_desc.AdapterLuid,
|
||||||
&IID_IDXGIAdapter, (void **)&adapter);
|
&IID_IDXGIAdapter, (void **)&adapter);
|
||||||
todo_wine ok(hr == S_OK, "Failed to enum adapter by LUID, hr %#x.\n", hr);
|
todo_wine ok(hr == S_OK, "Failed to enum adapter by LUID, hr %#x.\n", hr);
|
||||||
|
@ -4949,6 +4953,9 @@ static void test_multi_adapter(void)
|
||||||
return;
|
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);
|
hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter);
|
||||||
if (hr == DXGI_ERROR_NOT_FOUND)
|
if (hr == DXGI_ERROR_NOT_FOUND)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue