dinput: Implement GetProperty for JOYSTICKID (Linux driver).

This commit is contained in:
Lucas Zawacki 2012-05-29 13:42:26 -03:00 committed by Alexandre Julliard
parent 29cac72d1a
commit fbfdc6db65
2 changed files with 39 additions and 2 deletions

View File

@ -541,6 +541,42 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
return JoystickLinuxWImpl_Acquire(IDirectInputDevice8W_from_impl(This));
}
/******************************************************************************
* GetProperty : get input device properties
*/
static HRESULT WINAPI JoystickLinuxWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph)
{
JoystickImpl *This = impl_from_IDirectInputDevice8W(iface);
TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph);
_dump_DIPROPHEADER(pdiph);
if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid)) {
case (DWORD_PTR) DIPROP_JOYSTICKID:
{
LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph;
pd->dwData = get_joystick_index(&This->generic.base.guid);
TRACE("DIPROP_JOYSTICKID(%d)\n", pd->dwData);
break;
}
default:
return JoystickWGenericImpl_GetProperty(iface, rguid, pdiph);
}
return DI_OK;
}
static HRESULT WINAPI JoystickLinuxAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph)
{
JoystickImpl *This = impl_from_IDirectInputDevice8A(iface);
return JoystickLinuxWImpl_GetProperty(IDirectInputDevice8W_from_impl(This), rguid, pdiph);
}
/******************************************************************************
* Unacquire : frees the joystick
*/
@ -655,7 +691,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
IDirectInputDevice2AImpl_Release,
JoystickAGenericImpl_GetCapabilities,
IDirectInputDevice2AImpl_EnumObjects,
JoystickAGenericImpl_GetProperty,
JoystickLinuxAImpl_GetProperty,
JoystickAGenericImpl_SetProperty,
JoystickLinuxAImpl_Acquire,
JoystickLinuxAImpl_Unacquire,
@ -691,7 +727,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
IDirectInputDevice2WImpl_Release,
JoystickWGenericImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects,
JoystickWGenericImpl_GetProperty,
JoystickLinuxWImpl_GetProperty,
JoystickWGenericImpl_SetProperty,
JoystickLinuxWImpl_Acquire,
JoystickLinuxWImpl_Unacquire,

View File

@ -905,6 +905,7 @@ typedef const DIPROPSTRING *LPCDIPROPSTRING;
#define DIPROP_CALIBRATION MAKEDIPROP(11)
#define DIPROP_GUIDANDPATH MAKEDIPROP(12)
#define DIPROP_JOYSTICKID MAKEDIPROP(15)
#define DIPROP_KEYNAME MAKEDIPROP(20)
#define DIPROP_VIDPID MAKEDIPROP(24)