dinput: Implement HID joystick IDirectInputDevice8_GetDeviceInfo.

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-08-27 12:45:21 +02:00 committed by Alexandre Julliard
parent b36c6ae0e8
commit 787d4af53b
1 changed files with 10 additions and 2 deletions

View File

@ -54,6 +54,8 @@ struct hid_joystick
HANDLE device;
PHIDP_PREPARSED_DATA preparsed;
DIDEVICEINSTANCEW instance;
};
static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
@ -97,14 +99,18 @@ static HRESULT WINAPI hid_joystick_GetDeviceState( IDirectInputDevice8W *iface,
static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, DIDEVICEINSTANCEW *instance )
{
FIXME( "iface %p, instance %p stub!\n", iface, instance );
struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
TRACE( "iface %p, instance %p.\n", iface, instance );
if (!instance) return E_POINTER;
if (instance->dwSize != sizeof(DIDEVICEINSTANCE_DX3W) &&
instance->dwSize != sizeof(DIDEVICEINSTANCEW))
return DIERR_INVALIDPARAM;
return DIERR_UNSUPPORTED;
memcpy( instance, &impl->instance, instance->dwSize );
return S_OK;
}
static HRESULT WINAPI hid_joystick_BuildActionMap( IDirectInputDevice8W *iface, DIACTIONFORMATW *format,
@ -342,6 +348,8 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
&attrs, &caps, dinput->dwVersion );
if (hr != DI_OK) goto failed;
impl->instance = instance;
*out = &impl->base.IDirectInputDevice8W_iface;
return DI_OK;