Commit 3ec4ae83 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Factor all GetProperty implementations together.

parent f091aeae
...@@ -1186,59 +1186,105 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( IDirectInputDevice8W *iface ...@@ -1186,59 +1186,105 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( IDirectInputDevice8W *iface
return DI_OK; return DI_OK;
} }
/****************************************************************************** static BOOL CALLBACK find_object( const DIDEVICEOBJECTINSTANCEW *instance, void *context )
* GetProperty {
*/ *(DIDEVICEOBJECTINSTANCEW *)context = *instance;
return DIENUM_STOP;
}
HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph) HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty( IDirectInputDevice8W *iface, const GUID *guid,
DIPROPHEADER *header )
{ {
IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface );
DWORD object_mask = DIDFT_AXIS | DIDFT_BUTTON | DIDFT_POV;
DIDEVICEOBJECTINSTANCEW instance;
HRESULT hr;
TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(rguid), pdiph); TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header );
_dump_DIPROPHEADER(pdiph);
if (!IS_DIPROP(rguid)) return DI_OK; if (!header) return DIERR_INVALIDPARAM;
if (header->dwHeaderSize != sizeof(DIPROPHEADER)) return DIERR_INVALIDPARAM;
if (!IS_DIPROP( guid )) return DI_OK;
switch (LOWORD(rguid)) switch (LOWORD( guid ))
{ {
case (DWORD_PTR) DIPROP_BUFFERSIZE: case (DWORD_PTR)DIPROP_PRODUCTNAME:
{ case (DWORD_PTR)DIPROP_INSTANCENAME:
LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
if (header->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; return impl->vtbl->get_property( iface, LOWORD( guid ), header, NULL );
case (DWORD_PTR)DIPROP_VIDPID:
case (DWORD_PTR)DIPROP_JOYSTICKID:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
if (header->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
return impl->vtbl->get_property( iface, LOWORD( guid ), header, NULL );
case (DWORD_PTR)DIPROP_GUIDANDPATH:
if (header->dwSize != sizeof(DIPROPGUIDANDPATH)) return DIERR_INVALIDPARAM;
if (header->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
return impl->vtbl->get_property( iface, LOWORD( guid ), header, NULL );
case (DWORD_PTR)DIPROP_RANGE:
if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM;
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED;
hr = impl->vtbl->enum_objects( iface, header, object_mask, find_object, &instance );
if (FAILED(hr)) return hr;
if (hr == DIENUM_CONTINUE) return DIERR_NOTFOUND;
if (!(instance.dwType & DIDFT_AXIS)) return DIERR_UNSUPPORTED;
return impl->vtbl->get_property( iface, LOWORD( guid ), header, &instance );
case (DWORD_PTR)DIPROP_DEADZONE:
case (DWORD_PTR)DIPROP_SATURATION:
case (DWORD_PTR)DIPROP_GRANULARITY:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED;
hr = impl->vtbl->enum_objects( iface, header, object_mask, find_object, &instance );
if (FAILED(hr)) return hr;
if (hr == DIENUM_CONTINUE) return DIERR_NOTFOUND;
if (!(instance.dwType & DIDFT_AXIS)) return DIERR_UNSUPPORTED;
return impl->vtbl->get_property( iface, LOWORD( guid ), header, &instance );
pd->dwData = This->buffersize; case (DWORD_PTR)DIPROP_KEYNAME:
TRACE("buffersize = %d\n", pd->dwData); if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
break; hr = impl->vtbl->enum_objects( iface, header, object_mask, find_object, &instance );
} if (FAILED(hr)) return hr;
case (DWORD_PTR) DIPROP_USERNAME: if (hr == DIENUM_CONTINUE) return DIERR_NOTFOUND;
{ if (!(instance.dwType & DIDFT_BUTTON)) return DIERR_UNSUPPORTED;
LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph; return impl->vtbl->get_property( iface, LOWORD( guid ), header, &instance );
struct DevicePlayer *device_player;
if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; case (DWORD_PTR)DIPROP_AUTOCENTER:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
return DIERR_UNSUPPORTED;
LIST_FOR_EACH_ENTRY(device_player, &This->dinput->device_players, case (DWORD_PTR)DIPROP_BUFFERSIZE:
struct DevicePlayer, entry) {
DIPROPDWORD *value = (DIPROPDWORD *)header;
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
value->dwData = impl->buffersize;
return DI_OK;
}
case (DWORD_PTR)DIPROP_USERNAME:
{
DIPROPSTRING *value = (DIPROPSTRING *)header;
struct DevicePlayer *device_player;
if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
LIST_FOR_EACH_ENTRY( device_player, &impl->dinput->device_players, struct DevicePlayer, entry )
{
if (IsEqualGUID( &device_player->instance_guid, &impl->guid ))
{ {
if (IsEqualGUID(&device_player->instance_guid, &This->guid)) if (!*device_player->username) break;
{ lstrcpynW( value->wsz, device_player->username, ARRAY_SIZE(value->wsz) );
if (*device_player->username) return DI_OK;
{
lstrcpynW(ps->wsz, device_player->username, ARRAY_SIZE(ps->wsz));
return DI_OK;
}
else break;
}
} }
return S_FALSE;
} }
case (DWORD_PTR) DIPROP_VIDPID: return S_FALSE;
FIXME("DIPROP_VIDPID not implemented\n"); }
return DIERR_UNSUPPORTED; case (DWORD_PTR)DIPROP_CALIBRATION:
default: return DIERR_INVALIDPARAM;
FIXME("Unknown property %s\n", debugstr_guid(rguid)); default:
return DIERR_INVALIDPARAM; FIXME( "Unknown property %s\n", debugstr_guid( guid ) );
return DIERR_UNSUPPORTED;
} }
return DI_OK; return DI_OK;
......
...@@ -62,6 +62,8 @@ struct dinput_device_vtbl ...@@ -62,6 +62,8 @@ struct dinput_device_vtbl
HRESULT (*unacquire)( IDirectInputDevice8W *iface ); HRESULT (*unacquire)( IDirectInputDevice8W *iface );
HRESULT (*enum_objects)( IDirectInputDevice8W *iface, const DIPROPHEADER *filter, DWORD flags, HRESULT (*enum_objects)( IDirectInputDevice8W *iface, const DIPROPHEADER *filter, DWORD flags,
LPDIENUMDEVICEOBJECTSCALLBACKW callback, void *context ); LPDIENUMDEVICEOBJECTSCALLBACKW callback, void *context );
HRESULT (*get_property)( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
DIDEVICEOBJECTINSTANCEW *instance );
}; };
#define DEVICE_STATE_MAX_SIZE 1024 #define DEVICE_STATE_MAX_SIZE 1024
......
...@@ -661,97 +661,56 @@ static ULONG WINAPI hid_joystick_Release( IDirectInputDevice8W *iface ) ...@@ -661,97 +661,56 @@ static ULONG WINAPI hid_joystick_Release( IDirectInputDevice8W *iface )
return ref; return ref;
} }
static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_value_caps *caps, static HRESULT hid_joystick_internal_get_property( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
DIDEVICEOBJECTINSTANCEW *instance, void *data ) DIDEVICEOBJECTINSTANCEW *instance )
{
struct extra_caps *extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
DIPROPRANGE *value = data;
value->lMin = extra->range_min;
value->lMax = extra->range_max;
return DIENUM_STOP;
}
static BOOL get_property_prop_deadzone( struct hid_joystick *impl, struct hid_value_caps *caps,
DIDEVICEOBJECTINSTANCEW *instance, void *data )
{
struct extra_caps *extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
DIPROPDWORD *deadzone = data;
deadzone->dwData = extra->deadzone;
return DIENUM_STOP;
}
static BOOL get_property_prop_saturation( struct hid_joystick *impl, struct hid_value_caps *caps,
DIDEVICEOBJECTINSTANCEW *instance, void *data )
{
struct extra_caps *extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
DIPROPDWORD *saturation = data;
saturation->dwData = extra->saturation;
return DIENUM_STOP;
}
static BOOL get_property_prop_granularity( struct hid_joystick *impl, struct hid_value_caps *caps,
DIDEVICEOBJECTINSTANCEW *instance, void *data )
{
DIPROPDWORD *granularity = data;
granularity->dwData = 1;
return DIENUM_STOP;
}
static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid,
DIPROPHEADER *header )
{ {
struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
struct extra_caps *extra = NULL;
TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header ); if (instance) extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
if (!header) return DIERR_INVALIDPARAM; switch (property)
if (header->dwHeaderSize != sizeof(DIPROPHEADER)) return DIERR_INVALIDPARAM;
if (!IS_DIPROP( guid )) return DI_OK;
switch (LOWORD( guid ))
{ {
case (DWORD_PTR)DIPROP_RANGE: case (DWORD_PTR)DIPROP_RANGE:
if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; {
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; DIPROPRANGE *value = (DIPROPRANGE *)header;
if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) value->lMin = extra->range_min;
return DI_OK; value->lMax = extra->range_max;
return DIERR_NOTFOUND; return DI_OK;
}
case (DWORD_PTR)DIPROP_DEADZONE: case (DWORD_PTR)DIPROP_DEADZONE:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; {
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; DIPROPDWORD *value = (DIPROPDWORD *)header;
if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_deadzone, header ) == DIENUM_STOP) value->dwData = extra->deadzone;
return DI_OK; return DI_OK;
return DIERR_NOTFOUND; }
case (DWORD_PTR)DIPROP_SATURATION: case (DWORD_PTR)DIPROP_SATURATION:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; {
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; DIPROPDWORD *value = (DIPROPDWORD *)header;
if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_saturation, header ) == DIENUM_STOP) value->dwData = extra->saturation;
return DI_OK; return DI_OK;
return DIERR_NOTFOUND; }
case (DWORD_PTR)DIPROP_GRANULARITY: case (DWORD_PTR)DIPROP_GRANULARITY:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM; {
if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; DIPROPDWORD *value = (DIPROPDWORD *)header;
if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_granularity, header ) == DIENUM_STOP) value->dwData = 1;
return DI_OK; return DI_OK;
return DIERR_NOTFOUND; }
case (DWORD_PTR)DIPROP_PRODUCTNAME: case (DWORD_PTR)DIPROP_PRODUCTNAME:
{ {
DIPROPSTRING *value = (DIPROPSTRING *)header; DIPROPSTRING *value = (DIPROPSTRING *)header;
if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
lstrcpynW( value->wsz, impl->base.instance.tszProductName, MAX_PATH ); lstrcpynW( value->wsz, impl->base.instance.tszProductName, MAX_PATH );
return DI_OK; return DI_OK;
} }
case (DWORD_PTR)DIPROP_INSTANCENAME: case (DWORD_PTR)DIPROP_INSTANCENAME:
{ {
DIPROPSTRING *value = (DIPROPSTRING *)header; DIPROPSTRING *value = (DIPROPSTRING *)header;
if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
lstrcpynW( value->wsz, impl->base.instance.tszInstanceName, MAX_PATH ); lstrcpynW( value->wsz, impl->base.instance.tszInstanceName, MAX_PATH );
return DI_OK; return DI_OK;
} }
case (DWORD_PTR)DIPROP_VIDPID: case (DWORD_PTR)DIPROP_VIDPID:
{ {
DIPROPDWORD *value = (DIPROPDWORD *)header; DIPROPDWORD *value = (DIPROPDWORD *)header;
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
if (!impl->attrs.VendorID || !impl->attrs.ProductID) return DIERR_UNSUPPORTED; if (!impl->attrs.VendorID || !impl->attrs.ProductID) return DIERR_UNSUPPORTED;
value->dwData = MAKELONG( impl->attrs.VendorID, impl->attrs.ProductID ); value->dwData = MAKELONG( impl->attrs.VendorID, impl->attrs.ProductID );
return DI_OK; return DI_OK;
...@@ -759,25 +718,18 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con ...@@ -759,25 +718,18 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con
case (DWORD_PTR)DIPROP_JOYSTICKID: case (DWORD_PTR)DIPROP_JOYSTICKID:
{ {
DIPROPDWORD *value = (DIPROPDWORD *)header; DIPROPDWORD *value = (DIPROPDWORD *)header;
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
value->dwData = impl->base.instance.guidInstance.Data3; value->dwData = impl->base.instance.guidInstance.Data3;
return DI_OK; return DI_OK;
} }
case (DWORD_PTR)DIPROP_GUIDANDPATH: case (DWORD_PTR)DIPROP_GUIDANDPATH:
{ {
DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header; DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header;
if (header->dwSize != sizeof(DIPROPGUIDANDPATH)) return DIERR_INVALIDPARAM;
lstrcpynW( value->wszPath, impl->device_path, MAX_PATH ); lstrcpynW( value->wszPath, impl->device_path, MAX_PATH );
return DI_OK; return DI_OK;
} }
case (DWORD_PTR)DIPROP_AUTOCENTER:
if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
return DIERR_UNSUPPORTED;
default:
return IDirectInputDevice2WImpl_GetProperty( iface, guid, header );
} }
return DI_OK; return DIERR_UNSUPPORTED;
} }
static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_value_caps *caps, static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_value_caps *caps,
...@@ -1298,7 +1250,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = ...@@ -1298,7 +1250,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
/*** IDirectInputDevice methods ***/ /*** IDirectInputDevice methods ***/
IDirectInputDevice2WImpl_GetCapabilities, IDirectInputDevice2WImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects, IDirectInputDevice2WImpl_EnumObjects,
hid_joystick_GetProperty, IDirectInputDevice2WImpl_GetProperty,
hid_joystick_SetProperty, hid_joystick_SetProperty,
IDirectInputDevice2WImpl_Acquire, IDirectInputDevice2WImpl_Acquire,
IDirectInputDevice2WImpl_Unacquire, IDirectInputDevice2WImpl_Unacquire,
...@@ -1551,6 +1503,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl = ...@@ -1551,6 +1503,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl =
hid_joystick_internal_acquire, hid_joystick_internal_acquire,
hid_joystick_internal_unacquire, hid_joystick_internal_unacquire,
hid_joystick_internal_enum_objects, hid_joystick_internal_enum_objects,
hid_joystick_internal_get_property,
}; };
static DWORD device_type_for_version( DWORD type, DWORD version ) static DWORD device_type_for_version( DWORD type, DWORD version )
......
...@@ -273,46 +273,6 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W ifac ...@@ -273,46 +273,6 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W ifac
return DI_OK; return DI_OK;
} }
/******************************************************************************
* GetProperty : Retrieves information about the input device.
*/
static HRESULT WINAPI SysKeyboardWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface,
REFGUID rguid, LPDIPROPHEADER pdiph)
{
SysKeyboardImpl *This = impl_from_IDirectInputDevice8W(iface);
TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(rguid), pdiph);
_dump_DIPROPHEADER(pdiph);
if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid))
{
case (DWORD_PTR)DIPROP_KEYNAME:
{
HRESULT hr;
LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph;
DIDEVICEOBJECTINSTANCEW didoi;
if (pdiph->dwSize != sizeof(DIPROPSTRING))
return DIERR_INVALIDPARAM;
didoi.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW);
hr = IDirectInputDevice8_GetObjectInfo( iface, &didoi, ps->diph.dwObj, ps->diph.dwHow );
if (hr == DI_OK)
memcpy(ps->wsz, didoi.tszName, sizeof(ps->wsz));
return hr;
}
case (DWORD_PTR) DIPROP_VIDPID:
case (DWORD_PTR) DIPROP_RANGE:
return DIERR_UNSUPPORTED;
default:
return IDirectInputDevice2WImpl_GetProperty( iface, rguid, pdiph );
}
return DI_OK;
}
static HRESULT keyboard_internal_acquire( IDirectInputDevice8W *iface ) static HRESULT keyboard_internal_acquire( IDirectInputDevice8W *iface )
{ {
return DI_OK; return DI_OK;
...@@ -388,12 +348,28 @@ static HRESULT keyboard_internal_enum_objects( IDirectInputDevice8W *iface, cons ...@@ -388,12 +348,28 @@ static HRESULT keyboard_internal_enum_objects( IDirectInputDevice8W *iface, cons
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
static HRESULT keyboard_internal_get_property( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
DIDEVICEOBJECTINSTANCEW *instance )
{
switch (property)
{
case (DWORD_PTR)DIPROP_KEYNAME:
{
DIPROPSTRING *value = (DIPROPSTRING *)header;
lstrcpynW( value->wsz, instance->tszName, ARRAY_SIZE(value->wsz) );
return DI_OK;
}
}
return DIERR_UNSUPPORTED;
}
static const struct dinput_device_vtbl keyboard_internal_vtbl = static const struct dinput_device_vtbl keyboard_internal_vtbl =
{ {
NULL, NULL,
keyboard_internal_acquire, keyboard_internal_acquire,
keyboard_internal_unacquire, keyboard_internal_unacquire,
keyboard_internal_enum_objects, keyboard_internal_enum_objects,
keyboard_internal_get_property,
}; };
static const IDirectInputDevice8WVtbl SysKeyboardWvt = static const IDirectInputDevice8WVtbl SysKeyboardWvt =
...@@ -403,7 +379,7 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt = ...@@ -403,7 +379,7 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt =
IDirectInputDevice2WImpl_Release, IDirectInputDevice2WImpl_Release,
IDirectInputDevice2WImpl_GetCapabilities, IDirectInputDevice2WImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects, IDirectInputDevice2WImpl_EnumObjects,
SysKeyboardWImpl_GetProperty, IDirectInputDevice2WImpl_GetProperty,
IDirectInputDevice2WImpl_SetProperty, IDirectInputDevice2WImpl_SetProperty,
IDirectInputDevice2WImpl_Acquire, IDirectInputDevice2WImpl_Acquire,
IDirectInputDevice2WImpl_Unacquire, IDirectInputDevice2WImpl_Unacquire,
......
...@@ -495,65 +495,6 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface, ...@@ -495,65 +495,6 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface,
return res; return res;
} }
/******************************************************************************
* GetProperty : get input device properties
*/
static HRESULT WINAPI SysMouseWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph)
{
SysMouseImpl *This = impl_from_IDirectInputDevice8W(iface);
TRACE("(%p) %s,%p\n", This, debugstr_guid(rguid), pdiph);
_dump_DIPROPHEADER(pdiph);
if (IS_DIPROP(rguid)) {
switch (LOWORD(rguid)) {
case (DWORD_PTR) DIPROP_GRANULARITY: {
LPDIPROPDWORD pr = (LPDIPROPDWORD) pdiph;
if (
((pdiph->dwHow == DIPH_BYOFFSET) &&
((pdiph->dwObj == DIMOFS_X) ||
(pdiph->dwObj == DIMOFS_Y)))
||
((pdiph->dwHow == DIPH_BYID) &&
((pdiph->dwObj == (DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS)) ||
(pdiph->dwObj == (DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS))))
){
/* Set granularity of X/Y Axis to 1. See MSDN on DIPROP_GRANULARITY */
pr->dwData = 1;
} else {
/* We'll just assume that the app asks about the Z axis */
pr->dwData = WHEEL_DELTA;
}
break;
}
case (DWORD_PTR) DIPROP_RANGE: {
LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph;
if ((pdiph->dwHow == DIPH_BYID) &&
((pdiph->dwObj == (DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS)) ||
(pdiph->dwObj == (DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS)))) {
/* Querying the range of either the X or the Y axis. As I do
not know the range, do as if the range were
unrestricted...*/
pr->lMin = DIPROPRANGE_NOMIN;
pr->lMax = DIPROPRANGE_NOMAX;
}
break;
}
case (DWORD_PTR) DIPROP_VIDPID:
return DIERR_UNSUPPORTED;
default:
return IDirectInputDevice2WImpl_GetProperty(iface, rguid, pdiph);
}
}
return DI_OK;
}
static HRESULT mouse_internal_acquire( IDirectInputDevice8W *iface ) static HRESULT mouse_internal_acquire( IDirectInputDevice8W *iface )
{ {
SysMouseImpl *impl = impl_from_IDirectInputDevice8W( iface ); SysMouseImpl *impl = impl_from_IDirectInputDevice8W( iface );
...@@ -731,12 +672,36 @@ static HRESULT mouse_internal_enum_objects( IDirectInputDevice8W *iface, const D ...@@ -731,12 +672,36 @@ static HRESULT mouse_internal_enum_objects( IDirectInputDevice8W *iface, const D
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
static HRESULT mouse_internal_get_property( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
DIDEVICEOBJECTINSTANCEW *instance )
{
switch (property)
{
case (DWORD_PTR)DIPROP_RANGE:
{
DIPROPRANGE *range = (DIPROPRANGE *)header;
range->lMin = DIPROPRANGE_NOMIN;
range->lMax = DIPROPRANGE_NOMAX;
return DI_OK;
}
case (DWORD_PTR)DIPROP_GRANULARITY:
{
DIPROPDWORD *value = (DIPROPDWORD *)header;
if (instance->dwType == DIMOFS_Z) value->dwData = WHEEL_DELTA;
else value->dwData = 1;
return DI_OK;
}
}
return DIERR_UNSUPPORTED;
}
static const struct dinput_device_vtbl mouse_internal_vtbl = static const struct dinput_device_vtbl mouse_internal_vtbl =
{ {
NULL, NULL,
mouse_internal_acquire, mouse_internal_acquire,
mouse_internal_unacquire, mouse_internal_unacquire,
mouse_internal_enum_objects, mouse_internal_enum_objects,
mouse_internal_get_property,
}; };
static const IDirectInputDevice8WVtbl SysMouseWvt = static const IDirectInputDevice8WVtbl SysMouseWvt =
...@@ -746,7 +711,7 @@ static const IDirectInputDevice8WVtbl SysMouseWvt = ...@@ -746,7 +711,7 @@ static const IDirectInputDevice8WVtbl SysMouseWvt =
IDirectInputDevice2WImpl_Release, IDirectInputDevice2WImpl_Release,
IDirectInputDevice2WImpl_GetCapabilities, IDirectInputDevice2WImpl_GetCapabilities,
IDirectInputDevice2WImpl_EnumObjects, IDirectInputDevice2WImpl_EnumObjects,
SysMouseWImpl_GetProperty, IDirectInputDevice2WImpl_GetProperty,
IDirectInputDevice2WImpl_SetProperty, IDirectInputDevice2WImpl_SetProperty,
IDirectInputDevice2WImpl_Acquire, IDirectInputDevice2WImpl_Acquire,
IDirectInputDevice2WImpl_Unacquire, IDirectInputDevice2WImpl_Unacquire,
......
...@@ -1291,18 +1291,14 @@ static void test_mouse_info(void) ...@@ -1291,18 +1291,14 @@ static void test_mouse_info(void)
prop_dword.diph.dwHow = DIPH_BYOFFSET; prop_dword.diph.dwHow = DIPH_BYOFFSET;
prop_dword.diph.dwObj = DIMOFS_X; prop_dword.diph.dwObj = DIMOFS_X;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYOFFSET; prop_range.diph.dwHow = DIPH_BYOFFSET;
prop_range.diph.dwObj = DIMOFS_X; prop_range.diph.dwObj = DIMOFS_X;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwHow = DIPH_DEVICE;
...@@ -1340,44 +1336,34 @@ static void test_mouse_info(void) ...@@ -1340,44 +1336,34 @@ static void test_mouse_info(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_TYPENAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr ); ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr );
ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) ); ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph );
ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_dword.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYOFFSET; prop_dword.diph.dwHow = DIPH_BYOFFSET;
...@@ -1387,18 +1373,14 @@ static void test_mouse_info(void) ...@@ -1387,18 +1373,14 @@ static void test_mouse_info(void)
ok( hr == DI_OK, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DI_OK, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
ok( prop_dword.dwData == 1, "got %d expected 1\n", prop_dword.dwData ); ok( prop_dword.dwData == 1, "got %d expected 1\n", prop_dword.dwData );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_range.lMin = 0xdeadbeef; prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef; prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( hr == DI_OK, "GetProperty DIPROP_RANGE returned %#x\n", hr );
todo_wine
ok( prop_range.lMin == DIPROPRANGE_NOMIN, "got %d expected %d\n", prop_range.lMin, DIPROPRANGE_NOMIN ); ok( prop_range.lMin == DIPROPRANGE_NOMIN, "got %d expected %d\n", prop_range.lMin, DIPROPRANGE_NOMIN );
todo_wine
ok( prop_range.lMax == DIPROPRANGE_NOMAX, "got %d expected %d\n", prop_range.lMax, DIPROPRANGE_NOMAX ); ok( prop_range.lMax == DIPROPRANGE_NOMAX, "got %d expected %d\n", prop_range.lMax, DIPROPRANGE_NOMAX );
res = 0; res = 0;
...@@ -1632,18 +1614,14 @@ static void test_keyboard_info(void) ...@@ -1632,18 +1614,14 @@ static void test_keyboard_info(void)
prop_dword.diph.dwHow = DIPH_BYOFFSET; prop_dword.diph.dwHow = DIPH_BYOFFSET;
prop_dword.diph.dwObj = 1; prop_dword.diph.dwObj = 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYOFFSET; prop_range.diph.dwHow = DIPH_BYOFFSET;
prop_range.diph.dwObj = 1; prop_range.diph.dwObj = 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE; prop_dword.diph.dwHow = DIPH_DEVICE;
...@@ -1681,56 +1659,43 @@ static void test_keyboard_info(void) ...@@ -1681,56 +1659,43 @@ static void test_keyboard_info(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_INSTANCENAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_INSTANCENAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_PRODUCTNAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_PRODUCTNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_TYPENAME returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr ); ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr );
ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) ); ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_CALIBRATION, &prop_dword.diph );
ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_CALIBRATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_AUTOCENTER returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwHow = DIPH_BYUSAGE;
prop_dword.diph.dwObj = MAKELONG( HID_USAGE_KEYBOARD_LCTRL, HID_USAGE_PAGE_KEYBOARD ); prop_dword.diph.dwObj = MAKELONG( HID_USAGE_KEYBOARD_LCTRL, HID_USAGE_PAGE_KEYBOARD );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYOFFSET; prop_dword.diph.dwHow = DIPH_BYOFFSET;
prop_dword.diph.dwObj = 1; prop_dword.diph.dwObj = 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_SATURATION, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_SATURATION returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYOFFSET; prop_range.diph.dwHow = DIPH_BYOFFSET;
prop_range.diph.dwObj = 1; prop_range.diph.dwObj = 1;
......
...@@ -4004,7 +4004,6 @@ static void test_simple_joystick(void) ...@@ -4004,7 +4004,6 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_DEADZONE, &prop_dword.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_DEADZONE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_GRANULARITY returned %#x\n", hr );
......
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