Commit fbfdc6db authored by Lucas Zawacki's avatar Lucas Zawacki Committed by Alexandre Julliard

dinput: Implement GetProperty for JOYSTICKID (Linux driver).

parent 29cac72d
......@@ -542,6 +542,42 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
}
/******************************************************************************
* 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
*/
static HRESULT WINAPI JoystickLinuxWImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
......@@ -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,
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment