From ba532a3edba9677b8660df10513c2d13cb711c4b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 20 Nov 2008 13:32:00 +0100 Subject: [PATCH] dxgi: Implement IDXGIDevice::GetAdapter(). --- dlls/dxgi/device.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index 7ccece64ec8..1b82b2ade88 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -117,9 +117,24 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IDXGIDevice *iface, REFII static HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IDXGIDevice *iface, IDXGIAdapter **adapter) { - FIXME("iface %p, adapter %p stub!\n", iface, adapter); + struct dxgi_device *This = (struct dxgi_device *)iface; + WINED3DDEVICE_CREATION_PARAMETERS create_parameters; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, adapter %p\n", iface, adapter); + + EnterCriticalSection(&dxgi_cs); + + hr = IWineD3DDevice_GetCreationParameters(This->wined3d_device, &create_parameters); + if (FAILED(hr)) + { + LeaveCriticalSection(&dxgi_cs); + return hr; + } + + LeaveCriticalSection(&dxgi_cs); + + return IWineDXGIFactory_EnumAdapters(This->factory, create_parameters.AdapterOrdinal, adapter); } static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IDXGIDevice *iface,