Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/dinput/device.c | 4 +++- dlls/dinput/dinput_main.c | 4 ++-- dlls/dinput/effect_linuxinput.c | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index c9d24a9174..0c75a6ec36 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -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 c02bafad10..0855cb41cd 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -528,7 +528,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; }
@@ -543,7 +543,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 7477bc757d..4b2f317ce3 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);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53392
Your paranoid android.
=== debian9 (32 bit report) ===
dinput: keyboard.c:153: Test failed: Keyboard event not processed, skipping test