[PATCH 1/8] d3dx9_36: COM cleanup for the ID3DXEffect iface.

Michael Stefaniuc mstefani at redhat.de
Wed Jan 26 17:17:42 CST 2011


---
 dlls/d3dx9_36/effect.c |  171 +++++++++++++++++++++++++-----------------------
 1 files changed, 88 insertions(+), 83 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index e4c9007..d1c6094 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -29,14 +29,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl;
 
 typedef struct ID3DXEffectImpl {
-    const ID3DXEffectVtbl *lpVtbl;
+    ID3DXEffect ID3DXEffect_iface;
     LONG ref;
 } ID3DXEffectImpl;
 
+static inline ID3DXEffectImpl *impl_from_ID3DXEffect(ID3DXEffect *iface)
+{
+    return CONTAINING_RECORD(iface, ID3DXEffectImpl, ID3DXEffect_iface);
+}
+
 /*** IUnknown methods ***/
 static HRESULT WINAPI ID3DXEffectImpl_QueryInterface(ID3DXEffect* iface, REFIID riid, void** object)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), object);
 
@@ -44,7 +49,7 @@ static HRESULT WINAPI ID3DXEffectImpl_QueryInterface(ID3DXEffect* iface, REFIID
         IsEqualGUID(riid, &IID_ID3DXBaseEffect) ||
         IsEqualGUID(riid, &IID_ID3DXEffect))
     {
-        This->lpVtbl->AddRef(iface);
+        This->ID3DXEffect_iface.lpVtbl->AddRef(iface);
         *object = This;
         return S_OK;
     }
@@ -56,7 +61,7 @@ static HRESULT WINAPI ID3DXEffectImpl_QueryInterface(ID3DXEffect* iface, REFIID
 
 static ULONG WINAPI ID3DXEffectImpl_AddRef(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
 
@@ -65,7 +70,7 @@ static ULONG WINAPI ID3DXEffectImpl_AddRef(ID3DXEffect* iface)
 
 static ULONG WINAPI ID3DXEffectImpl_Release(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
     TRACE("(%p)->(): Release from %u\n", This, ref + 1);
@@ -79,7 +84,7 @@ static ULONG WINAPI ID3DXEffectImpl_Release(ID3DXEffect* iface)
 /*** ID3DXBaseEffect methods ***/
 static HRESULT WINAPI ID3DXEffectImpl_GetDesc(ID3DXEffect* iface, D3DXEFFECT_DESC* desc)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, desc);
 
@@ -88,7 +93,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetDesc(ID3DXEffect* iface, D3DXEFFECT_DES
 
 static HRESULT WINAPI ID3DXEffectImpl_GetParameterDesc(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXPARAMETER_DESC* desc)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, desc);
 
@@ -97,7 +102,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetParameterDesc(ID3DXEffect* iface, D3DXH
 
 static HRESULT WINAPI ID3DXEffectImpl_GetTechniqueDesc(ID3DXEffect* iface, D3DXHANDLE technique, D3DXTECHNIQUE_DESC* desc)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, technique, desc);
 
@@ -106,7 +111,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetTechniqueDesc(ID3DXEffect* iface, D3DXH
 
 static HRESULT WINAPI ID3DXEffectImpl_GetPassDesc(ID3DXEffect* iface, D3DXHANDLE pass, D3DXPASS_DESC* desc)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, pass, desc);
 
@@ -115,7 +120,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetPassDesc(ID3DXEffect* iface, D3DXHANDLE
 
 static HRESULT WINAPI ID3DXEffectImpl_GetFunctionDesc(ID3DXEffect* iface, D3DXHANDLE shader, D3DXFUNCTION_DESC* desc)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, shader, desc);
 
@@ -124,7 +129,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetFunctionDesc(ID3DXEffect* iface, D3DXHA
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameter(ID3DXEffect* iface, D3DXHANDLE parameter, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u): stub\n", This, parameter, index);
 
@@ -133,7 +138,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameter(ID3DXEffect* iface, D3DXHA
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterByName(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR name)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %s): stub\n", This, parameter, name);
 
@@ -142,7 +147,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterByName(ID3DXEffect* iface,
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterBySemantic(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR semantic)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %s): stub\n", This, parameter, semantic);
 
@@ -151,7 +156,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterBySemantic(ID3DXEffect* ifa
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterElement(ID3DXEffect* iface, D3DXHANDLE parameter, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u): stub\n", This, parameter, index);
 
@@ -160,7 +165,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterElement(ID3DXEffect* iface,
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechnique(ID3DXEffect* iface, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%u): stub\n", This, index);
 
@@ -169,7 +174,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechnique(ID3DXEffect* iface, UINT i
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechniqueByName(ID3DXEffect* iface, LPCSTR name)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%s): stub\n", This, name);
 
@@ -178,7 +183,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechniqueByName(ID3DXEffect* iface,
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPass(ID3DXEffect* iface, D3DXHANDLE technique, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u): stub\n", This, technique, index);
 
@@ -187,7 +192,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPass(ID3DXEffect* iface, D3DXHANDLE
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPassByName(ID3DXEffect* iface, D3DXHANDLE technique, LPCSTR name)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %s): stub\n", This, technique, name);
 
@@ -196,7 +201,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPassByName(ID3DXEffect* iface, D3DXH
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunction(ID3DXEffect* iface, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%u): stub\n", This, index);
 
@@ -205,7 +210,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunction(ID3DXEffect* iface, UINT in
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunctionByName(ID3DXEffect* iface, LPCSTR name)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%s): stub\n", This, name);
 
@@ -214,7 +219,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunctionByName(ID3DXEffect* iface, L
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotation(ID3DXEffect* iface, D3DXHANDLE object, UINT index)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u): stub\n", This, object, index);
 
@@ -223,7 +228,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotation(ID3DXEffect* iface, D3DXH
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotationByName(ID3DXEffect* iface, D3DXHANDLE object, LPCSTR name)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %s): stub\n", This, object, name);
 
@@ -232,7 +237,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotationByName(ID3DXEffect* iface,
 
 static HRESULT WINAPI ID3DXEffectImpl_SetValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPCVOID data, UINT bytes)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, data, bytes);
 
@@ -241,7 +246,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetValue(ID3DXEffect* iface, D3DXHANDLE pa
 
 static HRESULT WINAPI ID3DXEffectImpl_GetValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPVOID data, UINT bytes)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, data, bytes);
 
@@ -250,7 +255,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetValue(ID3DXEffect* iface, D3DXHANDLE pa
 
 static HRESULT WINAPI ID3DXEffectImpl_SetBool(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL b)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u): stub\n", This, parameter, b);
 
@@ -259,7 +264,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetBool(ID3DXEffect* iface, D3DXHANDLE par
 
 static HRESULT WINAPI ID3DXEffectImpl_GetBool(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL* b)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, b);
 
@@ -268,7 +273,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetBool(ID3DXEffect* iface, D3DXHANDLE par
 
 static HRESULT WINAPI ID3DXEffectImpl_SetBoolArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST BOOL* b, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, b, count);
 
@@ -277,7 +282,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetBoolArray(ID3DXEffect* iface, D3DXHANDL
 
 static HRESULT WINAPI ID3DXEffectImpl_GetBoolArray(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL* b, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, b, count);
 
@@ -286,7 +291,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetBoolArray(ID3DXEffect* iface, D3DXHANDL
 
 static HRESULT WINAPI ID3DXEffectImpl_SetInt(ID3DXEffect* iface, D3DXHANDLE parameter, INT n)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %d): stub\n", This, parameter, n);
 
@@ -295,7 +300,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetInt(ID3DXEffect* iface, D3DXHANDLE para
 
 static HRESULT WINAPI ID3DXEffectImpl_GetInt(ID3DXEffect* iface, D3DXHANDLE parameter, INT* n)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, n);
 
@@ -304,7 +309,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetInt(ID3DXEffect* iface, D3DXHANDLE para
 
 static HRESULT WINAPI ID3DXEffectImpl_SetIntArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST INT* n, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, n, count);
 
@@ -313,7 +318,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetIntArray(ID3DXEffect* iface, D3DXHANDLE
 
 static HRESULT WINAPI ID3DXEffectImpl_GetIntArray(ID3DXEffect* iface, D3DXHANDLE parameter, INT* n, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, n, count);
 
@@ -322,7 +327,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetIntArray(ID3DXEffect* iface, D3DXHANDLE
 
 static HRESULT WINAPI ID3DXEffectImpl_SetFloat(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT f)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %f): stub\n", This, parameter, f);
 
@@ -331,7 +336,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetFloat(ID3DXEffect* iface, D3DXHANDLE pa
 
 static HRESULT WINAPI ID3DXEffectImpl_GetFloat(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT* f)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, f);
 
@@ -340,7 +345,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetFloat(ID3DXEffect* iface, D3DXHANDLE pa
 
 static HRESULT WINAPI ID3DXEffectImpl_SetFloatArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST FLOAT* f, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, f, count);
 
@@ -349,7 +354,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetFloatArray(ID3DXEffect* iface, D3DXHAND
 
 static HRESULT WINAPI ID3DXEffectImpl_GetFloatArray(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT* f, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, f, count);
 
@@ -358,7 +363,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetFloatArray(ID3DXEffect* iface, D3DXHAND
 
 static HRESULT WINAPI ID3DXEffectImpl_SetVector(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXVECTOR4* vector)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, vector);
 
@@ -367,7 +372,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetVector(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_GetVector(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXVECTOR4* vector)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, vector);
 
@@ -376,7 +381,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetVector(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_SetVectorArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, vector, count);
 
@@ -385,7 +390,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetVectorArray(ID3DXEffect* iface, D3DXHAN
 
 static HRESULT WINAPI ID3DXEffectImpl_GetVectorArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, vector, count);
 
@@ -394,7 +399,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetVectorArray(ID3DXEffect* iface, D3DXHAN
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrix(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
 
@@ -403,7 +408,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrix(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrix(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
 
@@ -412,7 +417,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrix(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -421,7 +426,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrixArray(ID3DXEffect* iface, D3DXHAN
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -430,7 +435,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrixArray(ID3DXEffect* iface, D3DXHAN
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixPointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -439,7 +444,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrixPointerArray(ID3DXEffect* iface,
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixPointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -448,7 +453,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrixPointerArray(ID3DXEffect* iface,
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTranspose(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
 
@@ -457,7 +462,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTranspose(ID3DXEffect* iface, D3D
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTranspose(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
 
@@ -466,7 +471,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTranspose(ID3DXEffect* iface, D3D
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposeArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -475,7 +480,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposeArray(ID3DXEffect* iface
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposeArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -484,7 +489,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposeArray(ID3DXEffect* iface
 
 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposePointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -493,7 +498,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposePointerArray(ID3DXEffect
 
 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposePointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
 
@@ -502,7 +507,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposePointerArray(ID3DXEffect
 
 static HRESULT WINAPI ID3DXEffectImpl_SetString(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR string)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, string);
 
@@ -511,7 +516,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetString(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_GetString(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR* string)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, string);
 
@@ -520,7 +525,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetString(ID3DXEffect* iface, D3DXHANDLE p
 
 static HRESULT WINAPI ID3DXEffectImpl_SetTexture(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, texture);
 
@@ -529,7 +534,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTexture(ID3DXEffect* iface, D3DXHANDLE
 
 static HRESULT WINAPI ID3DXEffectImpl_GetTexture(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, texture);
 
@@ -538,7 +543,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetTexture(ID3DXEffect* iface, D3DXHANDLE
 
 static HRESULT WINAPI ID3DXEffectImpl_GetPixelShader(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, pshader);
 
@@ -547,7 +552,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetPixelShader(ID3DXEffect* iface, D3DXHAN
 
 static HRESULT WINAPI ID3DXEffectImpl_GetVertexShader(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, vshader);
 
@@ -556,7 +561,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetVertexShader(ID3DXEffect* iface, D3DXHA
 
 static HRESULT WINAPI ID3DXEffectImpl_SetArrayRange(ID3DXEffect* iface, D3DXHANDLE parameter, UINT start, UINT end)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %u, %u): stub\n", This, parameter, start, end);
 
@@ -566,7 +571,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetArrayRange(ID3DXEffect* iface, D3DXHAND
 /*** ID3DXEffect methods ***/
 static HRESULT WINAPI ID3DXEffectImpl_GetPool(ID3DXEffect* iface, LPD3DXEFFECTPOOL* pool)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, pool);
 
@@ -575,7 +580,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetPool(ID3DXEffect* iface, LPD3DXEFFECTPO
 
 static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect* iface, D3DXHANDLE technique)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, technique);
 
@@ -584,7 +589,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect* iface, D3DXHANDL
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetCurrentTechnique(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -593,7 +598,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_GetCurrentTechnique(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_ValidateTechnique(ID3DXEffect* iface, D3DXHANDLE technique)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, technique);
 
@@ -602,7 +607,7 @@ static HRESULT WINAPI ID3DXEffectImpl_ValidateTechnique(ID3DXEffect* iface, D3DX
 
 static HRESULT WINAPI ID3DXEffectImpl_FindNextValidTechnique(ID3DXEffect* iface, D3DXHANDLE technique, D3DXHANDLE* next_technique)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, technique, next_technique);
 
@@ -611,7 +616,7 @@ static HRESULT WINAPI ID3DXEffectImpl_FindNextValidTechnique(ID3DXEffect* iface,
 
 static BOOL WINAPI ID3DXEffectImpl_IsParameterUsed(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXHANDLE technique)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, parameter, technique);
 
@@ -620,7 +625,7 @@ static BOOL WINAPI ID3DXEffectImpl_IsParameterUsed(ID3DXEffect* iface, D3DXHANDL
 
 static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect* iface, UINT *passes, DWORD flags)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %#x): stub\n", This, passes, flags);
 
@@ -629,7 +634,7 @@ static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect* iface, UINT *passes, DW
 
 static HRESULT WINAPI ID3DXEffectImpl_BeginPass(ID3DXEffect* iface, UINT pass)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%u): stub\n", This, pass);
 
@@ -638,7 +643,7 @@ static HRESULT WINAPI ID3DXEffectImpl_BeginPass(ID3DXEffect* iface, UINT pass)
 
 static HRESULT WINAPI ID3DXEffectImpl_CommitChanges(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -647,7 +652,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CommitChanges(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_EndPass(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -656,7 +661,7 @@ static HRESULT WINAPI ID3DXEffectImpl_EndPass(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_End(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -665,7 +670,7 @@ static HRESULT WINAPI ID3DXEffectImpl_End(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_GetDevice(ID3DXEffect* iface, LPDIRECT3DDEVICE9* device)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, device);
 
@@ -674,7 +679,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetDevice(ID3DXEffect* iface, LPDIRECT3DDE
 
 static HRESULT WINAPI ID3DXEffectImpl_OnLostDevice(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -683,7 +688,7 @@ static HRESULT WINAPI ID3DXEffectImpl_OnLostDevice(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_OnResetDevice(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -692,7 +697,7 @@ static HRESULT WINAPI ID3DXEffectImpl_OnResetDevice(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_SetStateManager(ID3DXEffect* iface, LPD3DXEFFECTSTATEMANAGER manager)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, manager);
 
@@ -701,7 +706,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetStateManager(ID3DXEffect* iface, LPD3DX
 
 static HRESULT WINAPI ID3DXEffectImpl_GetStateManager(ID3DXEffect* iface, LPD3DXEFFECTSTATEMANAGER* manager)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, manager);
 
@@ -710,7 +715,7 @@ static HRESULT WINAPI ID3DXEffectImpl_GetStateManager(ID3DXEffect* iface, LPD3DX
 
 static HRESULT WINAPI ID3DXEffectImpl_BeginParameterBlock(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -719,7 +724,7 @@ static HRESULT WINAPI ID3DXEffectImpl_BeginParameterBlock(ID3DXEffect* iface)
 
 static D3DXHANDLE WINAPI ID3DXEffectImpl_EndParameterBlock(ID3DXEffect* iface)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(): stub\n", This);
 
@@ -728,7 +733,7 @@ static D3DXHANDLE WINAPI ID3DXEffectImpl_EndParameterBlock(ID3DXEffect* iface)
 
 static HRESULT WINAPI ID3DXEffectImpl_ApplyParameterBlock(ID3DXEffect* iface, D3DXHANDLE parameter_block)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, parameter_block);
 
@@ -737,7 +742,7 @@ static HRESULT WINAPI ID3DXEffectImpl_ApplyParameterBlock(ID3DXEffect* iface, D3
 
 static HRESULT WINAPI ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect* iface, D3DXHANDLE parameter_block)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p): stub\n", This, parameter_block);
 
@@ -746,7 +751,7 @@ static HRESULT WINAPI ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect* iface, D
 
 static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect* iface, LPDIRECT3DDEVICE9 device, LPD3DXEFFECT* effect)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p): stub\n", This, device, effect);
 
@@ -755,7 +760,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect* iface, LPDIRECT3D
 
 static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPCVOID data, UINT byte_offset, UINT bytes)
 {
-    ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
+    ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
 
     FIXME("(%p)->(%p, %p, %u, %u): stub\n", This, parameter, data, byte_offset, bytes);
 
@@ -881,10 +886,10 @@ HRESULT WINAPI D3DXCreateEffectEx(LPDIRECT3DDEVICE9 device,
         return E_OUTOFMEMORY;
     }
 
-    object->lpVtbl = &ID3DXEffect_Vtbl;
+    object->ID3DXEffect_iface.lpVtbl = &ID3DXEffect_Vtbl;
     object->ref = 1;
 
-    *effect = (LPD3DXEFFECT)object;
+    *effect = &object->ID3DXEffect_iface;
 
     return D3D_OK;
 }
-- 
1.7.3.5



More information about the wine-patches mailing list