Commit c69bb924 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d10: COM cleanup for the ID3D10ShaderReflection iface.

parent 9635f8b6
......@@ -276,10 +276,10 @@ HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10Shad
return E_OUTOFMEMORY;
}
object->vtbl = &d3d10_shader_reflection_vtbl;
object->ID3D10ShaderReflection_iface.lpVtbl = &d3d10_shader_reflection_vtbl;
object->refcount = 1;
*reflector = (ID3D10ShaderReflection *)object;
*reflector = &object->ID3D10ShaderReflection_iface;
TRACE("Created ID3D10ShaderReflection %p\n", object);
......
......@@ -217,7 +217,7 @@ struct d3d10_effect
extern const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl DECLSPEC_HIDDEN;
struct d3d10_shader_reflection
{
const struct ID3D10ShaderReflectionVtbl *vtbl;
ID3D10ShaderReflection ID3D10ShaderReflection_iface;
LONG refcount;
};
......
......@@ -27,6 +27,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
/* IUnknown methods */
static inline struct d3d10_shader_reflection *impl_from_ID3D10ShaderReflection(ID3D10ShaderReflection *iface)
{
return CONTAINING_RECORD(iface, struct d3d10_shader_reflection, ID3D10ShaderReflection_iface);
}
static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_QueryInterface(ID3D10ShaderReflection *iface, REFIID riid, void **object)
{
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
......@@ -47,7 +52,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_QueryInterface(ID3D10Sh
static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_AddRef(ID3D10ShaderReflection *iface)
{
struct d3d10_shader_reflection *This = (struct d3d10_shader_reflection *)iface;
struct d3d10_shader_reflection *This = impl_from_ID3D10ShaderReflection(iface);
ULONG refcount = InterlockedIncrement(&This->refcount);
TRACE("%p increasing refcount to %u\n", This, refcount);
......@@ -57,7 +62,7 @@ static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_AddRef(ID3D10ShaderReflec
static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderReflection *iface)
{
struct d3d10_shader_reflection *This = (struct d3d10_shader_reflection *)iface;
struct d3d10_shader_reflection *This = impl_from_ID3D10ShaderReflection(iface);
ULONG refcount = InterlockedDecrement(&This->refcount);
TRACE("%p decreasing refcount to %u\n", This, refcount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment