From 15216098e0b934c1a342e82edf4ac7d833b9a37f Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Sun, 9 Jan 2011 15:43:09 -0700 Subject: [PATCH] dinput: COM cleanup - use proper DirectInput interface with IUknown calls. --- dlls/dinput/device.c | 2 +- dlls/dinput/dinput_main.c | 2 +- dlls/dinput/joystick_linux.c | 2 +- dlls/dinput/joystick_linuxinput.c | 2 +- dlls/dinput/joystick_osx.c | 2 +- dlls/dinput/keyboard.c | 2 +- dlls/dinput/mouse.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 807a3742aa2..596969862c2 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -712,7 +712,7 @@ ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) list_remove( &This->entry ); LeaveCriticalSection( &This->dinput->crit ); - IDirectInput_Release((LPDIRECTINPUTDEVICE8A)This->dinput); + IDirectInput_Release(&This->dinput->IDirectInput7A_iface); This->crit.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->crit); diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index e46f83e2a83..646a4f84846 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -153,7 +153,7 @@ HRESULT WINAPI DirectInputCreateEx( if (!check_hook_thread()) { - IUnknown_Release( (LPDIRECTINPUT7A)This ); + IUnknown_Release( &This->IDirectInput7A_iface ); return DIERR_GENERIC; } diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index d489ef3b9ad..588a54b56d1 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -368,7 +368,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di newDevice->generic.props[i].lSaturation = 0; } - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps); newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED; diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 1bb3398bbd1..75a44ca0d2b 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -504,7 +504,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm if (newDevice->joydev->has_ff) newDevice->generic.devcaps.dwFlags |= DIDC_FORCEFEEDBACK; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); return newDevice; failed: diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index 2b4ea12e3d6..7daccd471ec 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -807,7 +807,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di /* initialize default properties */ get_osx_device_elements_props(newDevice); - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput); + IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps); newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED; diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 245559f1292..dda15c19edb 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -236,7 +236,7 @@ static SysKeyboardImpl *alloc_device(REFGUID rguid, const void *kvt, IDirectInpu df->dwNumObjs = idx; newDevice->base.data_format.wine_df = df; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->base.dinput); + IDirectInput_AddRef(&newDevice->base.dinput->IDirectInput7A_iface); return newDevice; failed: diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index c7801870449..5e0e0425211 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -223,7 +223,7 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm df->rgodf[i].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON; newDevice->base.data_format.wine_df = df; - IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->base.dinput); + IDirectInput_AddRef(&newDevice->base.dinput->IDirectInput7A_iface); return newDevice; failed: