From e9f9c15016c4650a00c74916fbcaa5d1c7141d23 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 28 Jan 2014 10:09:24 +0100 Subject: [PATCH] dxgi: Store IWineDXGIAdapter pointers in the factory. --- dlls/dxgi/dxgi_private.h | 2 +- dlls/dxgi/factory.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 1ae997c490e..20401c7d4f4 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -82,7 +82,7 @@ struct dxgi_factory LONG refcount; struct wined3d *wined3d; UINT adapter_count; - IDXGIAdapter **adapters; + IWineDXGIAdapter **adapters; }; HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN; diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 72927c53639..e0aa0359564 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface) for (i = 0; i < This->adapter_count; ++i) { - IDXGIAdapter_Release(This->adapters[i]); + IWineDXGIAdapter_Release(This->adapters[i]); } HeapFree(GetProcessHeap(), 0, This->adapters); @@ -139,7 +139,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *ifa return DXGI_ERROR_NOT_FOUND; } - *adapter = This->adapters[adapter_idx]; + *adapter = (IDXGIAdapter *)This->adapters[adapter_idx]; IDXGIAdapter_AddRef(*adapter); TRACE("Returning adapter %p\n", *adapter); @@ -335,7 +335,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) for (j = 0; j < i; ++j) { - IDXGIAdapter_Release(factory->adapters[j]); + IWineDXGIAdapter_Release(factory->adapters[j]); } hr = E_OUTOFMEMORY; goto fail; @@ -351,12 +351,12 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) HeapFree(GetProcessHeap(), 0, adapter); for (j = 0; j < i; ++j) { - IDXGIAdapter_Release(factory->adapters[j]); + IWineDXGIAdapter_Release(factory->adapters[j]); } goto fail; } - factory->adapters[i] = (IDXGIAdapter *)adapter; + factory->adapters[i] = &adapter->IWineDXGIAdapter_iface; } return S_OK;