Alistair Leslie-Hughes : dinput: Trace reference count in a consistent way.

Alexandre Julliard julliard at winehq.org
Mon Jun 10 13:43:54 CDT 2019


Module: wine
Branch: master
Commit: dba4428b6d2a31c572fd55d64c1f6edc174f47d7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=dba4428b6d2a31c572fd55d64c1f6edc174f47d7

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Jun  7 06:03:37 2019 +0000

dinput: Trace reference count in a consistent way.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/device.c            | 6 ++++--
 dlls/dinput/dinput_main.c       | 4 ++--
 dlls/dinput/effect_linuxinput.c | 6 +++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index c9d24a9..28329d0 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1140,7 +1140,7 @@ ULONG WINAPI IDirectInputDevice2WImpl_Release(LPDIRECTINPUTDEVICE8W iface)
     IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface);
     ULONG ref = InterlockedDecrement(&(This->ref));
 
-    TRACE("(%p) releasing from %d\n", This, ref + 1);
+    TRACE("(%p) ref %d\n", This, ref);
 
     if (ref) return ref;
 
@@ -1215,7 +1215,9 @@ HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A ifa
 ULONG WINAPI IDirectInputDevice2WImpl_AddRef(LPDIRECTINPUTDEVICE8W iface)
 {
     IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface);
-    return InterlockedIncrement(&This->ref);
+    ULONG ref = InterlockedIncrement(&This->ref);
+    TRACE( "(%p) ref %d\n", This, ref );
+    return ref;
 }
 
 ULONG WINAPI IDirectInputDevice2AImpl_AddRef(LPDIRECTINPUTDEVICE8A iface)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index acf2cf3..a690505 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -527,7 +527,7 @@ static ULONG WINAPI IDirectInputAImpl_AddRef(LPDIRECTINPUT7A iface)
     IDirectInputImpl *This = impl_from_IDirectInput7A( iface );
     ULONG ref = InterlockedIncrement(&This->ref);
 
-    TRACE( "(%p) incrementing from %d\n", This, ref - 1);
+    TRACE( "(%p) ref %d\n", This, ref );
     return ref;
 }
 
@@ -542,7 +542,7 @@ static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT7A iface)
     IDirectInputImpl *This = impl_from_IDirectInput7A( iface );
     ULONG ref = InterlockedDecrement( &This->ref );
 
-    TRACE( "(%p) releasing from %d\n", This, ref + 1 );
+    TRACE( "(%p) ref %d\n", This, ref );
 
     if (ref == 0)
     {
diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c
index 7477bc7..4b2f317 100644
--- a/dlls/dinput/effect_linuxinput.c
+++ b/dlls/dinput/effect_linuxinput.c
@@ -167,7 +167,9 @@ static ULONG WINAPI LinuxInputEffectImpl_AddRef(
 	LPDIRECTINPUTEFFECT iface)
 {
     LinuxInputEffectImpl *This = impl_from_IDirectInputEffect(iface);
-    return InterlockedIncrement(&(This->ref));
+    ULONG ref = InterlockedIncrement(&This->ref);
+    TRACE( "(%p) ref %d\n", This, ref );
+    return ref;
 }
 
 static HRESULT WINAPI LinuxInputEffectImpl_Download(
@@ -759,6 +761,8 @@ static ULONG WINAPI LinuxInputEffectImpl_Release(LPDIRECTINPUTEFFECT iface)
     LinuxInputEffectImpl *This = impl_from_IDirectInputEffect(iface);
     ULONG ref = InterlockedDecrement(&(This->ref));
 
+    TRACE( "(%p) ref %d\n", This, ref );
+
     if (ref == 0)
     {
         LinuxInputEffectImpl_Stop(iface);




More information about the wine-cvs mailing list