[PATCH 2/4] d3d10core: COM cleanup for the ID3D10VertexShader iface.

Michael Stefaniuc mstefani at redhat.de
Mon Jul 11 18:54:04 CDT 2011


---
 dlls/d3d10core/d3d10core_private.h |    2 +-
 dlls/d3d10core/device.c            |    2 +-
 dlls/d3d10core/shader.c            |    8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index 12fd54b..50d31b0 100644
--- a/dlls/d3d10core/d3d10core_private.h
+++ b/dlls/d3d10core/d3d10core_private.h
@@ -167,7 +167,7 @@ HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d10_
 /* ID3D10VertexShader */
 struct d3d10_vertex_shader
 {
-    const struct ID3D10VertexShaderVtbl *vtbl;
+    ID3D10VertexShader ID3D10VertexShader_iface;
     LONG refcount;
 
     struct wined3d_shader *wined3d_shader;
diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c
index 302c91e..0f4b75f 100644
--- a/dlls/d3d10core/device.c
+++ b/dlls/d3d10core/device.c
@@ -879,7 +879,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device *i
     }
 
     TRACE("Created vertex shader %p.\n", object);
-    *shader = (ID3D10VertexShader *)object;
+    *shader = &object->ID3D10VertexShader_iface;
 
     return S_OK;
 }
diff --git a/dlls/d3d10core/shader.c b/dlls/d3d10core/shader.c
index 6720c21..fe112dc 100644
--- a/dlls/d3d10core/shader.c
+++ b/dlls/d3d10core/shader.c
@@ -135,7 +135,7 @@ void shader_free_signature(struct wined3d_shader_signature *s)
 
 static inline struct d3d10_vertex_shader *impl_from_ID3D10VertexShader(ID3D10VertexShader *iface)
 {
-    return CONTAINING_RECORD(iface, struct d3d10_vertex_shader, vtbl);
+    return CONTAINING_RECORD(iface, struct d3d10_vertex_shader, ID3D10VertexShader_iface);
 }
 
 /* IUnknown methods */
@@ -162,7 +162,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface(ID3D10Vertex
 
 static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *iface)
 {
-    struct d3d10_vertex_shader *This = (struct d3d10_vertex_shader *)iface;
+    struct d3d10_vertex_shader *This = impl_from_ID3D10VertexShader(iface);
     ULONG refcount = InterlockedIncrement(&This->refcount);
 
     TRACE("%p increasing refcount to %u\n", This, refcount);
@@ -175,7 +175,7 @@ static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *if
 
 static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release(ID3D10VertexShader *iface)
 {
-    struct d3d10_vertex_shader *This = (struct d3d10_vertex_shader *)iface;
+    struct d3d10_vertex_shader *This = impl_from_ID3D10VertexShader(iface);
     ULONG refcount = InterlockedDecrement(&This->refcount);
 
     TRACE("%p decreasing refcount to %u\n", This, refcount);
@@ -250,7 +250,7 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
     struct d3d10_shader_info shader_info;
     HRESULT hr;
 
-    shader->vtbl = &d3d10_vertex_shader_vtbl;
+    shader->ID3D10VertexShader_iface.lpVtbl = &d3d10_vertex_shader_vtbl;
     shader->refcount = 1;
 
     shader_info.output_signature = &shader->output_signature;
-- 
1.7.4.4



More information about the wine-patches mailing list