From 49ad383e89a11c951c458f7d3c0ae1edf118c240 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 13 Feb 2015 10:40:52 +0100 Subject: [PATCH] dxgi: Implement dxgi_factory_SetPrivateData(). --- dlls/dxgi/dxgi_private.h | 1 + dlls/dxgi/factory.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 6653c21aa25..45f2404509d 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -88,6 +88,7 @@ struct dxgi_factory { IDXGIFactory1 IDXGIFactory1_iface; LONG refcount; + struct wined3d_private_store private_store; struct wined3d *wined3d; UINT adapter_count; IDXGIAdapter1 **adapters; diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 1e22f6f3186..13b72f04745 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -83,6 +83,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface) EnterCriticalSection(&dxgi_cs); wined3d_decref(factory->wined3d); LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); HeapFree(GetProcessHeap(), 0, factory); } @@ -92,9 +93,11 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface) static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); - return E_NOTIMPL; + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&factory->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface, @@ -284,12 +287,14 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended) factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl; factory->refcount = 1; + wined3d_private_store_init(&factory->private_store); EnterCriticalSection(&dxgi_cs); factory->wined3d = wined3d_create(0); if (!factory->wined3d) { LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); return DXGI_ERROR_UNSUPPORTED; } @@ -346,6 +351,7 @@ fail: EnterCriticalSection(&dxgi_cs); wined3d_decref(factory->wined3d); LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); return hr; } -- 2.11.4.GIT