From 9dfd95c6cf652ea5ec525fa258582ec11cdc6f4b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 13 Feb 2015 10:40:49 +0100 Subject: [PATCH] dxgi: Implement dxgi_adapter_SetPrivateData(). --- dlls/dxgi/adapter.c | 12 ++++++++---- dlls/dxgi/dxgi_private.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index a1359f0a78a..2b1023bcfd6 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -69,6 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface) if (!refcount) { IDXGIOutput_Release(adapter->output); + wined3d_private_store_cleanup(&adapter->private_store); HeapFree(GetProcessHeap(), 0, adapter); } @@ -78,9 +79,11 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface) static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *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_adapter *adapter = impl_from_IDXGIAdapter1(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(&adapter->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1 *iface, @@ -228,11 +231,12 @@ HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *par adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl; adapter->parent = parent; adapter->refcount = 1; + wined3d_private_store_init(&adapter->private_store); adapter->ordinal = ordinal; - output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output)); - if (!output) + if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output)))) { + wined3d_private_store_cleanup(&adapter->private_store); return E_OUTOFMEMORY; } dxgi_output_init(output, adapter); diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 55837f9e6b4..6653c21aa25 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -129,6 +129,7 @@ struct dxgi_adapter IDXGIAdapter1 IDXGIAdapter1_iface; struct dxgi_factory *parent; LONG refcount; + struct wined3d_private_store private_store; UINT ordinal; IDXGIOutput *output; };