[PATCH] d3dx9_36: Display new ref in AddRef and Release.

Christian Costa titan.costa at gmail.com
Sun Apr 21 16:58:19 CDT 2013


---
 dlls/d3dx9_36/effect.c |   28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index 7c1e1ae..db59301 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -1075,10 +1075,11 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_QueryInterface(ID3DXBaseEffect *iface,
 static ULONG WINAPI ID3DXBaseEffectImpl_AddRef(ID3DXBaseEffect *iface)
 {
     struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("iface %p: AddRef from %u\n", iface, This->ref);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-    return InterlockedIncrement(&This->ref);
+    return ref;
 }
 
 static ULONG WINAPI ID3DXBaseEffectImpl_Release(ID3DXBaseEffect *iface)
@@ -1086,7 +1087,7 @@ static ULONG WINAPI ID3DXBaseEffectImpl_Release(ID3DXBaseEffect *iface)
     struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("iface %p: Release from %u\n", iface, ref + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
     if (!ref)
     {
@@ -2838,10 +2839,11 @@ static HRESULT WINAPI ID3DXEffectImpl_QueryInterface(ID3DXEffect *iface, REFIID
 static ULONG WINAPI ID3DXEffectImpl_AddRef(ID3DXEffect *iface)
 {
     struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-    return InterlockedIncrement(&This->ref);
+    return ref;
 }
 
 static ULONG WINAPI ID3DXEffectImpl_Release(ID3DXEffect *iface)
@@ -2849,7 +2851,7 @@ static ULONG WINAPI ID3DXEffectImpl_Release(ID3DXEffect *iface)
     struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(): Release from %u\n", This, ref + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
     if (!ref)
     {
@@ -3808,10 +3810,11 @@ static HRESULT WINAPI ID3DXEffectCompilerImpl_QueryInterface(ID3DXEffectCompiler
 static ULONG WINAPI ID3DXEffectCompilerImpl_AddRef(ID3DXEffectCompiler *iface)
 {
     struct ID3DXEffectCompilerImpl *This = impl_from_ID3DXEffectCompiler(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("iface %p: AddRef from %u\n", iface, This->ref);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-    return InterlockedIncrement(&This->ref);
+    return ref;
 }
 
 static ULONG WINAPI ID3DXEffectCompilerImpl_Release(ID3DXEffectCompiler *iface)
@@ -3819,7 +3822,7 @@ static ULONG WINAPI ID3DXEffectCompilerImpl_Release(ID3DXEffectCompiler *iface)
     struct ID3DXEffectCompilerImpl *This = impl_from_ID3DXEffectCompiler(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("iface %p: Release from %u\n", iface, ref + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
     if (!ref)
     {
@@ -5920,10 +5923,11 @@ static HRESULT WINAPI ID3DXEffectPoolImpl_QueryInterface(ID3DXEffectPool *iface,
 static ULONG WINAPI ID3DXEffectPoolImpl_AddRef(ID3DXEffectPool *iface)
 {
     struct ID3DXEffectPoolImpl *This = impl_from_ID3DXEffectPool(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-    return InterlockedIncrement(&This->ref);
+    return ref;
 }
 
 static ULONG WINAPI ID3DXEffectPoolImpl_Release(ID3DXEffectPool *iface)
@@ -5931,7 +5935,7 @@ static ULONG WINAPI ID3DXEffectPoolImpl_Release(ID3DXEffectPool *iface)
     struct ID3DXEffectPoolImpl *This = impl_from_ID3DXEffectPool(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE("(%p)->(): Release from %u\n", This, ref + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
     if (!ref)
         HeapFree(GetProcessHeap(), 0, This);




More information about the wine-patches mailing list