dxgi: Implement dxgi_adapter_SetPrivateData().

This commit is contained in:
Henri Verbeet 2015-02-13 10:40:49 +01:00 committed by Alexandre Julliard
parent 849149d5d3
commit 9dfd95c6cf
2 changed files with 9 additions and 4 deletions

View File

@ -69,6 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
if (!refcount) if (!refcount)
{ {
IDXGIOutput_Release(adapter->output); IDXGIOutput_Release(adapter->output);
wined3d_private_store_cleanup(&adapter->private_store);
HeapFree(GetProcessHeap(), 0, adapter); HeapFree(GetProcessHeap(), 0, adapter);
} }
@ -78,9 +79,11 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface,
REFGUID guid, UINT data_size, const void *data) 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, 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->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl;
adapter->parent = parent; adapter->parent = parent;
adapter->refcount = 1; adapter->refcount = 1;
wined3d_private_store_init(&adapter->private_store);
adapter->ordinal = ordinal; adapter->ordinal = ordinal;
output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output)); if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output))))
if (!output)
{ {
wined3d_private_store_cleanup(&adapter->private_store);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
dxgi_output_init(output, adapter); dxgi_output_init(output, adapter);

View File

@ -129,6 +129,7 @@ struct dxgi_adapter
IDXGIAdapter1 IDXGIAdapter1_iface; IDXGIAdapter1 IDXGIAdapter1_iface;
struct dxgi_factory *parent; struct dxgi_factory *parent;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store;
UINT ordinal; UINT ordinal;
IDXGIOutput *output; IDXGIOutput *output;
}; };