Henri Verbeet : d3d10: Implement ID3D10Effect::GetDevice().

Alexandre Julliard julliard at winehq.org
Fri Mar 6 09:49:35 CST 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Mar  6 08:43:48 2009 +0100

d3d10: Implement ID3D10Effect::GetDevice().

---

 dlls/d3d10/d3d10_main.c    |    2 ++
 dlls/d3d10/d3d10_private.h |    1 +
 dlls/d3d10/effect.c        |   10 ++++++++--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c
index 88fd12b..5746fba 100644
--- a/dlls/d3d10/d3d10_main.c
+++ b/dlls/d3d10/d3d10_main.c
@@ -224,6 +224,8 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl
 
     object->vtbl = &d3d10_effect_vtbl;
     object->refcount = 1;
+    ID3D10Device_AddRef(device);
+    object->device = device;
 
     hr = d3d10_effect_parse(object, data, data_size);
     if (FAILED(hr))
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h
index 01fa69c..129a49b 100644
--- a/dlls/d3d10/d3d10_private.h
+++ b/dlls/d3d10/d3d10_private.h
@@ -80,6 +80,7 @@ struct d3d10_effect
     const struct ID3D10EffectVtbl *vtbl;
     LONG refcount;
 
+    ID3D10Device *device;
     DWORD technique_count;
     DWORD index_offset;
     DWORD blendstate_count;
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index 02725dd..5e61f6e 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -589,6 +589,7 @@ static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface)
             }
             HeapFree(GetProcessHeap(), 0, This->techniques);
         }
+        ID3D10Device_Release(This->device);
         HeapFree(GetProcessHeap(), 0, This);
     }
 
@@ -613,9 +614,14 @@ static BOOL STDMETHODCALLTYPE d3d10_effect_IsPool(ID3D10Effect *iface)
 
 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3D10Device **device)
 {
-    FIXME("iface %p, device %p stub!\n", iface, device);
+    struct d3d10_effect *This = (struct d3d10_effect *)iface;
 
-    return E_NOTIMPL;
+    TRACE("iface %p, device %p\n", iface, device);
+
+    ID3D10Device_AddRef(This->device);
+    *device = This->device;
+
+    return S_OK;
 }
 
 static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc)




More information about the wine-cvs mailing list