Commit e9f9c150 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

dxgi: Store IWineDXGIAdapter pointers in the factory.

parent 127e9bc4
...@@ -82,7 +82,7 @@ struct dxgi_factory ...@@ -82,7 +82,7 @@ struct dxgi_factory
LONG refcount; LONG refcount;
struct wined3d *wined3d; struct wined3d *wined3d;
UINT adapter_count; UINT adapter_count;
IDXGIAdapter **adapters; IWineDXGIAdapter **adapters;
}; };
HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN; HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
......
...@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface) ...@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface)
for (i = 0; i < This->adapter_count; ++i) for (i = 0; i < This->adapter_count; ++i)
{ {
IDXGIAdapter_Release(This->adapters[i]); IWineDXGIAdapter_Release(This->adapters[i]);
} }
HeapFree(GetProcessHeap(), 0, This->adapters); HeapFree(GetProcessHeap(), 0, This->adapters);
...@@ -139,7 +139,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *ifa ...@@ -139,7 +139,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *ifa
return DXGI_ERROR_NOT_FOUND; return DXGI_ERROR_NOT_FOUND;
} }
*adapter = This->adapters[adapter_idx]; *adapter = (IDXGIAdapter *)This->adapters[adapter_idx];
IDXGIAdapter_AddRef(*adapter); IDXGIAdapter_AddRef(*adapter);
TRACE("Returning adapter %p\n", *adapter); TRACE("Returning adapter %p\n", *adapter);
...@@ -335,7 +335,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) ...@@ -335,7 +335,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory)
for (j = 0; j < i; ++j) for (j = 0; j < i; ++j)
{ {
IDXGIAdapter_Release(factory->adapters[j]); IWineDXGIAdapter_Release(factory->adapters[j]);
} }
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
goto fail; goto fail;
...@@ -351,12 +351,12 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) ...@@ -351,12 +351,12 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory)
HeapFree(GetProcessHeap(), 0, adapter); HeapFree(GetProcessHeap(), 0, adapter);
for (j = 0; j < i; ++j) for (j = 0; j < i; ++j)
{ {
IDXGIAdapter_Release(factory->adapters[j]); IWineDXGIAdapter_Release(factory->adapters[j]);
} }
goto fail; goto fail;
} }
factory->adapters[i] = (IDXGIAdapter *)adapter; factory->adapters[i] = &adapter->IWineDXGIAdapter_iface;
} }
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment