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:
parent
b36c6ae0e8
commit
787d4af53b
|
@ -54,6 +54,8 @@ struct hid_joystick
|
||||||
|
|
||||||
HANDLE device;
|
HANDLE device;
|
||||||
PHIDP_PREPARSED_DATA preparsed;
|
PHIDP_PREPARSED_DATA preparsed;
|
||||||
|
|
||||||
|
DIDEVICEINSTANCEW instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct hid_joystick *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
|
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 )
|
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) return E_POINTER;
|
||||||
if (instance->dwSize != sizeof(DIDEVICEINSTANCE_DX3W) &&
|
if (instance->dwSize != sizeof(DIDEVICEINSTANCE_DX3W) &&
|
||||||
instance->dwSize != sizeof(DIDEVICEINSTANCEW))
|
instance->dwSize != sizeof(DIDEVICEINSTANCEW))
|
||||||
return DIERR_INVALIDPARAM;
|
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,
|
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 );
|
&attrs, &caps, dinput->dwVersion );
|
||||||
if (hr != DI_OK) goto failed;
|
if (hr != DI_OK) goto failed;
|
||||||
|
|
||||||
|
impl->instance = instance;
|
||||||
|
|
||||||
*out = &impl->base.IDirectInputDevice8W_iface;
|
*out = &impl->base.IDirectInputDevice8W_iface;
|
||||||
return DI_OK;
|
return DI_OK;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue