From 42e7bd210fe641367962b04f5d8b3df4c09c2818 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 19 Aug 2014 22:47:51 +0200
Subject: [PATCH 314/358] dxgi: Improve stubs for MakeWindowAssociation and
 GetWindowAssociation.

---
 dlls/dxgi/dxgi_private.h |  1 +
 dlls/dxgi/factory.c      | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h
index 24487c3..9c5cfcc 100644
--- a/dlls/dxgi/dxgi_private.h
+++ b/dlls/dxgi/dxgi_private.h
@@ -113,6 +113,7 @@ struct dxgi_factory
     struct wined3d *wined3d;
     BOOL extended;
     HWND device_window;
+    HWND assoc_window;
 };
 
 HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index 7fc3279..d983928 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -174,16 +174,29 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *ifa
 static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface,
         HWND window, UINT flags)
 {
+    struct dxgi_factory *factory = impl_from_IWineDXGIFactory(iface);
+
     FIXME("iface %p, window %p, flags %#x stub!\n", iface, window, flags);
 
+    if (!window && flags)
+        return DXGI_ERROR_INVALID_CALL;
+
+    factory->assoc_window = window;
+
     return S_OK;
 }
 
 static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IWineDXGIFactory *iface, HWND *window)
 {
+    struct dxgi_factory *factory = impl_from_IWineDXGIFactory(iface);
+
     FIXME("iface %p, window %p stub!\n", iface, window);
 
-    return E_NOTIMPL;
+    if (!window)
+        return DXGI_ERROR_INVALID_CALL;
+
+    *window = factory->assoc_window;
+    return S_OK;
 }
 
 static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *iface,
-- 
1.9.1

