d3d10: COM cleanup for the ID3D10ShaderReflection iface.

This commit is contained in:
Michael Stefaniuc 2011-06-03 11:18:36 +02:00 committed by Alexandre Julliard
parent 9635f8b6ef
commit c69bb92463
3 changed files with 10 additions and 5 deletions

View file

@ -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);

View file

@ -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;
};

View file

@ -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);