From 944190bad442f19fba5e0073d284469bd2329652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 12 Apr 2016 12:29:40 +0200 Subject: [PATCH] dxgi: Partially implement dxgi_swapchain_GetContainingOutput(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/swapchain.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index b729970969d..da705e4de70 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -287,9 +287,32 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeTarget(IDXGISwapChain *ifa static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetContainingOutput(IDXGISwapChain *iface, IDXGIOutput **output) { - FIXME("iface %p, output %p stub!\n", iface, output); + IDXGIAdapter *adapter; + IDXGIDevice *device; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, output %p.\n", iface, output); + + if (FAILED(hr = dxgi_swapchain_GetDevice(iface, &IID_IDXGIDevice, (void **)&device))) + return hr; + + hr = IDXGIDevice_GetAdapter(device, &adapter); + IDXGIDevice_Release(device); + if (FAILED(hr)) + { + WARN("GetAdapter failed, hr %#x.\n", hr); + return hr; + } + + if (SUCCEEDED(IDXGIAdapter_EnumOutputs(adapter, 1, output))) + { + FIXME("Adapter has got multiple outputs, returning the first one.\n"); + IDXGIOutput_Release(*output); + } + + hr = IDXGIAdapter_EnumOutputs(adapter, 0, output); + IDXGIAdapter_Release(adapter); + return hr; } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetFrameStatistics(IDXGISwapChain *iface, DXGI_FRAME_STATISTICS *stats)