dxgi: Implement IDXGIFactory::EnumAdapters().

This commit is contained in:
Henri Verbeet 2008-11-18 09:27:58 +01:00 committed by Alexandre Julliard
parent 808bbeb065
commit 1988ed16db
2 changed files with 19 additions and 4 deletions

View File

@ -57,11 +57,11 @@ static void test_device_interfaces(ID3D10Device *device)
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj)))
IUnknown_Release(obj); IUnknown_Release(obj);
todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr); ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr);
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj)))
IUnknown_Release(obj); IUnknown_Release(obj);
todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr);
} }
START_TEST(device) START_TEST(device)

View File

@ -119,9 +119,24 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IWineDXGIFactory *iface,
static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface,
UINT adapter_idx, IDXGIAdapter **adapter) UINT adapter_idx, IDXGIAdapter **adapter)
{ {
FIXME("iface %p, adapter_idx %u, adapter %p stub!\n", iface, adapter_idx, adapter); struct dxgi_factory *This = (struct dxgi_factory *)iface;
return E_NOTIMPL; TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter);
if (!adapter) return DXGI_ERROR_INVALID_CALL;
if (adapter_idx >= This->adapter_count)
{
*adapter = NULL;
return DXGI_ERROR_NOT_FOUND;
}
*adapter = (IDXGIAdapter *)This->adapters[adapter_idx];
IDXGIAdapter_AddRef(*adapter);
TRACE("Returning adapter %p\n", *adapter);
return S_OK;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags) static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags)