[PATCH 4/5] dmusic: Display new ref in IDirectMusicBufferImpl_AddRef and IDirectMusicBufferImpl_Release.

Christian Costa titan.costa at gmail.com
Tue Apr 24 15:32:52 CDT 2012


---
 dlls/dmusic/buffer.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c
index f7ebac1..bc84fee 100644
--- a/dlls/dmusic/buffer.c
+++ b/dlls/dmusic/buffer.c
@@ -41,33 +41,33 @@ static HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface(LPDIRECTMUSICBUFFER
 	return E_NOINTERFACE;
 }
 
-static ULONG WINAPI IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface)
+static ULONG WINAPI IDirectMusicBufferImpl_AddRef(LPDIRECTMUSICBUFFER iface)
 {
-	IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface);
-	ULONG refCount = InterlockedIncrement(&This->ref);
+    IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
 
-	TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-	DMUSIC_LockModule();
+    DMUSIC_LockModule();
 
-	return refCount;
+    return ref;
 }
 
 static ULONG WINAPI IDirectMusicBufferImpl_Release(LPDIRECTMUSICBUFFER iface)
 {
-	IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface);
-	ULONG refCount = InterlockedDecrement(&This->ref);
+    IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface);
+    ULONG ref = InterlockedDecrement(&This->ref);
 
-	TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
+    TRACE("(%p)->(): new ref = %u\n", iface, ref);
 
-	if (!refCount) {
-		HeapFree(GetProcessHeap(), 0, This->data);
-		HeapFree(GetProcessHeap(), 0, This);
-	}
+    if (!ref) {
+        HeapFree(GetProcessHeap(), 0, This->data);
+        HeapFree(GetProcessHeap(), 0, This);
+    }
+
+    DMUSIC_UnlockModule();
 
-	DMUSIC_UnlockModule();
-	
-	return refCount;
+    return ref;
 }
 
 /* IDirectMusicBufferImpl IDirectMusicBuffer part: */




More information about the wine-patches mailing list