=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Implement d3d11_class_linkage_GetDevice().

Alexandre Julliard julliard at winehq.org
Tue May 9 17:21:01 CDT 2017


Module: wine
Branch: master
Commit: feb5aa437096c5aca1343556317dfa0eb1a327e8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=feb5aa437096c5aca1343556317dfa0eb1a327e8

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue May  9 12:51:43 2017 +0200

d3d11: Implement d3d11_class_linkage_GetDevice().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/d3d11_private.h |  1 +
 dlls/d3d11/shader.c        | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index cbc8d7c..b86486e 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -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,
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index b8c50d9..3699851 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -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;
 




More information about the wine-cvs mailing list