d3d11: Implement d3d11_class_linkage_GetDevice().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-05-09 12:51:43 +02:00 committed by Alexandre Julliard
parent 613a7e78cb
commit feb5aa4370
2 changed files with 12 additions and 1 deletions

View File

@ -373,6 +373,7 @@ struct d3d11_class_linkage
LONG refcount;
struct wined3d_private_store private_store;
ID3D11Device *device;
};
HRESULT d3d11_class_linkage_create(struct d3d_device *device,

View File

@ -2127,8 +2127,12 @@ static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *i
if (!refcount)
{
ID3D11Device *device = class_linkage->device;
wined3d_private_store_cleanup(&class_linkage->private_store);
HeapFree(GetProcessHeap(), 0, class_linkage);
ID3D11Device_Release(device);
}
return refcount;
@ -2137,7 +2141,11 @@ static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *i
static void STDMETHODCALLTYPE d3d11_class_linkage_GetDevice(ID3D11ClassLinkage *iface,
ID3D11Device **device)
{
FIXME("iface %p, device %p stub!\n", iface, device);
struct d3d11_class_linkage *class_linkage = impl_from_ID3D11ClassLinkage(iface);
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device_AddRef(*device = class_linkage->device);
}
static HRESULT STDMETHODCALLTYPE d3d11_class_linkage_GetPrivateData(ID3D11ClassLinkage *iface,
@ -2218,6 +2226,8 @@ HRESULT d3d11_class_linkage_create(struct d3d_device *device, struct d3d11_class
object->refcount = 1;
wined3d_private_store_init(&object->private_store);
ID3D11Device_AddRef(object->device = &device->ID3D11Device_iface);
TRACE("Created class linkage %p.\n", object);
*class_linkage = object;