dinput: Use the internal vtable for GetEffectInfo.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-10-21 09:53:43 +02:00 committed by Alexandre Julliard
parent 713d71c187
commit f54210590f
5 changed files with 18 additions and 16 deletions

View file

@ -1732,14 +1732,18 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( IDirectInputDevice8W *iface
return DI_OK;
}
HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
LPDIRECTINPUTDEVICE8W iface,
LPDIEFFECTINFOW lpdei,
REFGUID rguid)
HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info,
const GUID *guid )
{
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface);
FIXME("(%p)->(%p,%s): stub!\n", This, lpdei, debugstr_guid(rguid));
return DI_OK;
IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) );
if (!info) return E_POINTER;
if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM;
if (!(impl->caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_DEVICENOTREG;
if (!impl->vtbl->get_effect_info) return DIERR_UNSUPPORTED;
return impl->vtbl->get_effect_info( iface, info, guid );
}
HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut)

View file

@ -68,6 +68,7 @@ struct dinput_device_vtbl
DIDEVICEOBJECTINSTANCEW *instance );
HRESULT (*set_property)( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
const DIDEVICEOBJECTINSTANCEW *instance );
HRESULT (*get_effect_info)( IDirectInputDevice8W *iface, DIEFFECTINFOW *info, const GUID *guid );
};
#define DEVICE_STATE_MAX_SIZE 1024

View file

@ -838,8 +838,8 @@ failed:
return hr;
}
static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info,
const GUID *guid )
static HRESULT hid_joystick_internal_get_effect_info( IDirectInputDevice8W *iface, DIEFFECTINFOW *info,
const GUID *guid )
{
struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
struct pid_effect_update *effect_update = &impl->pid_effect_update;
@ -853,12 +853,6 @@ static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, D
USAGE usage = 0;
USHORT count;
TRACE( "iface %p, info %p, guid %s.\n", iface, info, debugstr_guid( guid ) );
if (!info) return E_POINTER;
if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM;
if (!(impl->base.caps.dwFlags & DIDC_FORCEFEEDBACK)) return DIERR_DEVICENOTREG;
switch ((usage = effect_guid_to_usage( guid )))
{
case PID_USAGE_ET_SQUARE:
@ -1085,7 +1079,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
/*** IDirectInputDevice2 methods ***/
hid_joystick_CreateEffect,
IDirectInputDevice2WImpl_EnumEffects,
hid_joystick_GetEffectInfo,
IDirectInputDevice2WImpl_GetEffectInfo,
hid_joystick_GetForceFeedbackState,
hid_joystick_SendForceFeedbackCommand,
hid_joystick_EnumCreatedEffectObjects,
@ -1326,6 +1320,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl =
hid_joystick_internal_enum_objects,
hid_joystick_internal_get_property,
hid_joystick_internal_set_property,
hid_joystick_internal_get_effect_info,
};
static DWORD device_type_for_version( DWORD type, DWORD version )

View file

@ -338,6 +338,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl =
keyboard_internal_enum_objects,
keyboard_internal_get_property,
keyboard_internal_set_property,
NULL,
};
static const IDirectInputDevice8WVtbl SysKeyboardWvt =

View file

@ -651,6 +651,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl =
mouse_internal_enum_objects,
mouse_internal_get_property,
mouse_internal_set_property,
NULL,
};
static const IDirectInputDevice8WVtbl SysMouseWvt =