[PATCH 6/6] dinput: Factor all SetProperty implementations together.

Rémi Bernon rbernon at codeweavers.com
Tue Oct 19 02:20:06 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/dinput/device.c         | 229 +++++++++++++++++++++--------------
 dlls/dinput/device_private.h |   2 +
 dlls/dinput/joystick_hid.c   | 113 ++++-------------
 dlls/dinput/keyboard.c       |   7 ++
 dlls/dinput/mouse.c          |   7 ++
 5 files changed, 179 insertions(+), 179 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 54645fa995e..cdaa76cd504 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1297,112 +1297,165 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty( IDirectInputDevice8W *iface
     return DI_OK;
 }
 
-/******************************************************************************
- *	SetProperty
- */
+struct set_object_property_params
+{
+    IDirectInputDevice8W *iface;
+    const DIPROPHEADER *header;
+    DWORD property;
+};
 
-HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty(
-        LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIPROPHEADER pdiph)
+static BOOL CALLBACK set_object_property( const DIDEVICEOBJECTINSTANCEW *instance, void *context )
 {
-    IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface);
+    struct set_object_property_params *params = context;
+    IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( params->iface );
+    impl->vtbl->set_property( params->iface, params->property, params->header, instance );
+    return DIENUM_CONTINUE;
+}
+
+HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( IDirectInputDevice8W *iface, const GUID *guid,
+                                                     const DIPROPHEADER *header )
+{
+    struct set_object_property_params params = {.iface = iface, .header = header, .property = LOWORD( guid )};
+    IDirectInputDeviceImpl *impl = impl_from_IDirectInputDevice8W( iface );
+    HRESULT hr;
 
-    TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(rguid), pdiph);
-    _dump_DIPROPHEADER(pdiph);
+    TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header );
 
-    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_RANGE:
+    {
+        const DIPROPRANGE *value = (const DIPROPRANGE *)header;
+        if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM;
+        if (value->lMin > value->lMax) return DIERR_INVALIDPARAM;
+        hr = impl->vtbl->enum_objects( iface, header, DIDFT_AXIS, set_object_property, &params );
+        if (FAILED(hr)) return hr;
+        return DI_OK;
+    }
+    case (DWORD_PTR)DIPROP_DEADZONE:
+    case (DWORD_PTR)DIPROP_SATURATION:
+    {
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
+        if (value->dwData > 10000) return DIERR_INVALIDPARAM;
+        hr = impl->vtbl->enum_objects( iface, header, DIDFT_AXIS, set_object_property, &params );
+        if (FAILED(hr)) return hr;
+        return DI_OK;
+    }
+    case (DWORD_PTR)DIPROP_AUTOCENTER:
+    {
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
+        EnterCriticalSection( &impl->crit );
+        if (impl->acquired) hr = DIERR_ACQUIRED;
+        else if (value->dwData > DIPROPAUTOCENTER_ON) hr = DIERR_INVALIDPARAM;
+        else hr = DIERR_UNSUPPORTED;
+        LeaveCriticalSection( &impl->crit );
+        return hr;
+    }
+    case (DWORD_PTR)DIPROP_FFLOAD:
+    case (DWORD_PTR)DIPROP_GRANULARITY:
+    case (DWORD_PTR)DIPROP_VIDPID:
+        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
+        return DIERR_READONLY;
+    case (DWORD_PTR)DIPROP_TYPENAME:
+    case (DWORD_PTR)DIPROP_USERNAME:
+        if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
+        return DIERR_READONLY;
+    case (DWORD_PTR)DIPROP_GUIDANDPATH:
+        if (header->dwSize != sizeof(DIPROPGUIDANDPATH)) return DIERR_INVALIDPARAM;
+        return DIERR_READONLY;
+    case (DWORD_PTR)DIPROP_AXISMODE:
     {
-        case (DWORD_PTR) DIPROP_AXISMODE:
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
+        if (header->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
+        if (header->dwHow == DIPH_DEVICE && header->dwObj) return DIERR_INVALIDPARAM;
+
+        TRACE( "Axis mode: %s\n", value->dwData == DIPROPAXISMODE_ABS ? "absolute" : "relative" );
+        EnterCriticalSection( &impl->crit );
+        if (impl->acquired) hr = DIERR_ACQUIRED;
+        else if (!impl->data_format.user_df) hr = DI_OK;
+        else
         {
-            LPCDIPROPDWORD pd = (LPCDIPROPDWORD)pdiph;
-
-            if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-            if (pdiph->dwHow == DIPH_DEVICE && pdiph->dwObj) return DIERR_INVALIDPARAM;
-            if (This->acquired) return DIERR_ACQUIRED;
-            if (pdiph->dwHow != DIPH_DEVICE) return DIERR_UNSUPPORTED;
-            if (!This->data_format.user_df) return DI_OK;
-
-            TRACE("Axis mode: %s\n", pd->dwData == DIPROPAXISMODE_ABS ? "absolute" :
-                                                                        "relative");
-
-            EnterCriticalSection(&This->crit);
-            This->data_format.user_df->dwFlags &= ~DIDFT_AXIS;
-            This->data_format.user_df->dwFlags |= pd->dwData == DIPROPAXISMODE_ABS ?
-                                                  DIDF_ABSAXIS : DIDF_RELAXIS;
-            LeaveCriticalSection(&This->crit);
-            break;
+            impl->data_format.user_df->dwFlags &= ~DIDFT_AXIS;
+            impl->data_format.user_df->dwFlags |= value->dwData == DIPROPAXISMODE_ABS ? DIDF_ABSAXIS : DIDF_RELAXIS;
+            hr = DI_OK;
         }
-        case (DWORD_PTR) DIPROP_BUFFERSIZE:
-        {
-            LPCDIPROPDWORD pd = (LPCDIPROPDWORD)pdiph;
-
-            if (pdiph->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-            if (This->acquired) return DIERR_ACQUIRED;
+        LeaveCriticalSection( &impl->crit );
+        return hr;
+    }
+    case (DWORD_PTR)DIPROP_BUFFERSIZE:
+    {
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
 
-            TRACE("buffersize = %d\n", pd->dwData);
+        TRACE( "buffersize = %d\n", value->dwData );
 
-            EnterCriticalSection(&This->crit);
+        EnterCriticalSection( &impl->crit );
+        if (impl->acquired) hr = DIERR_ACQUIRED;
+        else
+        {
+            impl->buffersize = value->dwData;
+            impl->queue_len = min( impl->buffersize, 1024 );
+            free( impl->data_queue );
 
-            This->buffersize  = pd->dwData;
-            This->queue_len = min(This->buffersize, 1024);
-            free( This->data_queue );
+            impl->data_queue = impl->queue_len ? malloc( impl->queue_len * sizeof(DIDEVICEOBJECTDATA) ) : NULL;
+            impl->queue_head = impl->queue_tail = impl->overflow = 0;
+            hr = DI_OK;
+        }
+        LeaveCriticalSection( &impl->crit );
+        return hr;
+    }
+    case (DWORD_PTR)DIPROP_APPDATA:
+    {
+        const DIPROPPOINTER *value = (const DIPROPPOINTER *)header;
+        int offset = -1;
+        if (header->dwSize != sizeof(DIPROPPOINTER)) return DIERR_INVALIDPARAM;
+
+        if (header->dwHow == DIPH_BYID)
+            offset = id_to_offset( &impl->data_format, header->dwObj );
+        else if (header->dwHow == DIPH_BYOFFSET)
+            offset = verify_offset( &impl->data_format, header->dwObj );
+        else
+            return DIERR_UNSUPPORTED;
 
-            This->data_queue = This->queue_len ? malloc( This->queue_len * sizeof(DIDEVICEOBJECTDATA) ) : NULL;
-            This->queue_head = This->queue_tail = This->overflow = 0;
+        if (offset == -1) return DIERR_OBJECTNOTFOUND;
+        if (!set_app_data( impl, offset, value->uData )) return DIERR_OUTOFMEMORY;
+        return DI_OK;
+    }
+    default:
+        FIXME( "Unknown property %s\n", debugstr_guid( guid ) );
+        return DIERR_UNSUPPORTED;
+    }
 
-            LeaveCriticalSection(&This->crit);
-            break;
-        }
-        case (DWORD_PTR) DIPROP_USERNAME:
-        {
-            LPCDIPROPSTRING ps = (LPCDIPROPSTRING)pdiph;
-            struct DevicePlayer *device_player;
-            BOOL found = FALSE;
+    return DI_OK;
+}
 
-            if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
+static void dinput_device_set_username( IDirectInputDeviceImpl *impl, const DIPROPSTRING *value )
+{
+    struct DevicePlayer *device_player;
+    BOOL found = FALSE;
 
-            LIST_FOR_EACH_ENTRY(device_player, &This->dinput->device_players,
-                struct DevicePlayer, entry)
-            {
-                if (IsEqualGUID(&device_player->instance_guid, &This->guid))
-                {
-                    found = TRUE;
-                    break;
-                }
-            }
-            if (!found && (device_player = malloc( sizeof(struct DevicePlayer) )))
-            {
-                list_add_tail(&This->dinput->device_players, &device_player->entry);
-                device_player->instance_guid = This->guid;
-            }
-            if (device_player)
-                lstrcpynW(device_player->username, ps->wsz, ARRAY_SIZE(device_player->username));
-            break;
-        }
-        case (DWORD_PTR) DIPROP_APPDATA:
+    LIST_FOR_EACH_ENTRY( device_player, &impl->dinput->device_players, struct DevicePlayer, entry )
+    {
+        if (IsEqualGUID( &device_player->instance_guid, &impl->guid ))
         {
-            int offset = -1;
-            LPCDIPROPPOINTER pp = (LPCDIPROPPOINTER)pdiph;
-            if (pdiph->dwSize != sizeof(DIPROPPOINTER)) return DIERR_INVALIDPARAM;
-
-            if (pdiph->dwHow == DIPH_BYID)
-                offset = id_to_offset(&This->data_format, pdiph->dwObj);
-            else if (pdiph->dwHow == DIPH_BYOFFSET)
-                offset = verify_offset(&This->data_format, pdiph->dwObj);
-            else
-                return DIERR_UNSUPPORTED;
-
-            if (offset == -1) return DIERR_OBJECTNOTFOUND;
-            if (!set_app_data(This, offset, pp->uData)) return DIERR_OUTOFMEMORY;
+            found = TRUE;
             break;
         }
-        default:
-            WARN("Unknown property %s\n", debugstr_guid(rguid));
-            return DIERR_UNSUPPORTED;
     }
-
-    return DI_OK;
+    if (!found && (device_player = malloc( sizeof(struct DevicePlayer) )))
+    {
+        list_add_tail( &impl->dinput->device_players, &device_player->entry );
+        device_player->instance_guid = impl->guid;
+    }
+    if (device_player)
+        lstrcpynW( device_player->username, value->wsz, ARRAY_SIZE(device_player->username) );
 }
 
 static BOOL CALLBACK get_object_info( const DIDEVICEOBJECTINSTANCEW *instance, void *data )
@@ -1827,7 +1880,7 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap( IDirectInputDevice8W *ifac
     dps.diph.dwHow = DIPH_DEVICE;
     if (flags & DIDSAM_NOUSER) dps.wsz[0] = '\0';
     else lstrcpynW( dps.wsz, username_buf, ARRAY_SIZE(dps.wsz) );
-    IDirectInputDevice2WImpl_SetProperty( iface, DIPROP_USERNAME, &dps.diph );
+    dinput_device_set_username( impl, &dps );
 
     /* Save the settings to disk */
     save_mapping_settings( iface, format, username_buf );
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index e4290e5960b..da1a90fda42 100644
--- a/dlls/dinput/device_private.h
+++ b/dlls/dinput/device_private.h
@@ -64,6 +64,8 @@ struct dinput_device_vtbl
                              LPDIENUMDEVICEOBJECTSCALLBACKW callback, void *context );
     HRESULT (*get_property)( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
                              DIDEVICEOBJECTINSTANCEW *instance );
+    HRESULT (*set_property)( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
+                             const DIDEVICEOBJECTINSTANCEW *instance );
 };
 
 #define DEVICE_STATE_MAX_SIZE 1024
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 8c9218cd4e7..3dc43c450e4 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -732,15 +732,14 @@ static HRESULT hid_joystick_internal_get_property( IDirectInputDevice8W *iface,
     return DIERR_UNSUPPORTED;
 }
 
-static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_value_caps *caps,
-                                     DIDEVICEOBJECTINSTANCEW *instance, void *data )
+static void set_extra_caps_range( struct hid_joystick *impl, const DIDEVICEOBJECTINSTANCEW *instance,
+                                  LONG min, LONG max )
 {
     struct extra_caps *extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
-    DIPROPRANGE *value = data;
     LONG tmp;
 
-    extra->range_min = value->lMin;
-    extra->range_max = value->lMax;
+    extra->range_min = min;
+    extra->range_max = max;
 
     if (instance->dwType & DIDFT_AXIS)
     {
@@ -751,96 +750,42 @@ static BOOL set_property_prop_range( struct hid_joystick *impl, struct hid_value
     else if (instance->dwType & DIDFT_POV)
     {
         tmp = extra->logical_max - extra->logical_min;
-        if (tmp > 0) extra->range_max -= value->lMax / (tmp + 1);
+        if (tmp > 0) extra->range_max -= max / (tmp + 1);
         *(LONG *)(impl->base.device_state + instance->dwOfs) = -1;
     }
-    return DIENUM_CONTINUE;
-}
-
-static BOOL set_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;
-    extra->deadzone = deadzone->dwData;
-    return DIENUM_CONTINUE;
-}
-
-static BOOL set_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;
-    extra->saturation = saturation->dwData;
-    return DIENUM_CONTINUE;
 }
 
-static HRESULT WINAPI hid_joystick_SetProperty( IDirectInputDevice8W *iface, const GUID *guid,
-                                                const DIPROPHEADER *header )
+static HRESULT hid_joystick_internal_set_property( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
+                                                   const DIDEVICEOBJECTINSTANCEW *instance )
 {
     struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
-    HRESULT hr;
-
-    TRACE( "iface %p, guid %s, header %p\n", iface, debugstr_guid( guid ), header );
+    struct extra_caps *extra = NULL;
 
-    if (!header) return DIERR_INVALIDPARAM;
-    if (header->dwHeaderSize != sizeof(DIPROPHEADER)) return DIERR_INVALIDPARAM;
-    if (!IS_DIPROP( guid )) return DI_OK;
+    if (instance) extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
 
-    switch (LOWORD( guid ))
+    switch (property)
     {
     case (DWORD_PTR)DIPROP_RANGE:
     {
-        DIPROPRANGE *value = (DIPROPRANGE *)header;
-        if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM;
-        if (value->lMin > value->lMax) return DIERR_INVALIDPARAM;
-        enum_objects( impl, header, DIDFT_AXIS, set_property_prop_range, (void *)header );
+        const DIPROPRANGE *value = (const DIPROPRANGE *)header;
+        set_extra_caps_range( impl, instance, value->lMin, value->lMax );
         return DI_OK;
     }
     case (DWORD_PTR)DIPROP_DEADZONE:
     {
-        DIPROPDWORD *value = (DIPROPDWORD *)header;
-        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-        if (value->dwData > 10000) return DIERR_INVALIDPARAM;
-        enum_objects( impl, header, DIDFT_AXIS, set_property_prop_deadzone, (void *)header );
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        extra->deadzone = value->dwData;
         return DI_OK;
     }
     case (DWORD_PTR)DIPROP_SATURATION:
     {
-        DIPROPDWORD *value = (DIPROPDWORD *)header;
-        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-        if (value->dwData > 10000) return DIERR_INVALIDPARAM;
-        enum_objects( impl, header, DIDFT_AXIS, set_property_prop_saturation, (void *)header );
+        const DIPROPDWORD *value = (const DIPROPDWORD *)header;
+        extra->saturation = value->dwData;
         return DI_OK;
     }
-    case (DWORD_PTR)DIPROP_AUTOCENTER:
-    {
-        DIPROPDWORD *value = (DIPROPDWORD *)header;
-        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-        EnterCriticalSection( &impl->base.crit );
-        if (impl->base.acquired) hr = DIERR_ACQUIRED;
-        else if (value->dwData > DIPROPAUTOCENTER_ON) hr = DIERR_INVALIDPARAM;
-        else hr = DIERR_UNSUPPORTED;
-        LeaveCriticalSection( &impl->base.crit );
-        return hr;
-    }
-    case (DWORD_PTR)DIPROP_FFLOAD:
-    case (DWORD_PTR)DIPROP_GRANULARITY:
-    case (DWORD_PTR)DIPROP_VIDPID:
-        if (header->dwSize != sizeof(DIPROPDWORD)) return DIERR_INVALIDPARAM;
-        return DIERR_READONLY;
-    case (DWORD_PTR)DIPROP_TYPENAME:
-    case (DWORD_PTR)DIPROP_USERNAME:
-        if (header->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM;
-        return DIERR_READONLY;
-    case (DWORD_PTR)DIPROP_GUIDANDPATH:
-        if (header->dwSize != sizeof(DIPROPGUIDANDPATH)) return DIERR_INVALIDPARAM;
-        return DIERR_READONLY;
-    default:
-        return IDirectInputDevice2WImpl_SetProperty( iface, guid, header );
     }
 
-    return DI_OK;
+    return DIERR_UNSUPPORTED;
 }
 
 static HRESULT hid_joystick_internal_acquire( IDirectInputDevice8W *iface )
@@ -1251,7 +1196,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
     IDirectInputDevice2WImpl_GetCapabilities,
     IDirectInputDevice2WImpl_EnumObjects,
     IDirectInputDevice2WImpl_GetProperty,
-    hid_joystick_SetProperty,
+    IDirectInputDevice2WImpl_SetProperty,
     IDirectInputDevice2WImpl_Acquire,
     IDirectInputDevice2WImpl_Unacquire,
     hid_joystick_GetDeviceState,
@@ -1504,6 +1449,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl =
     hid_joystick_internal_unacquire,
     hid_joystick_internal_enum_objects,
     hid_joystick_internal_get_property,
+    hid_joystick_internal_set_property,
 };
 
 static DWORD device_type_for_version( DWORD type, DWORD version )
@@ -1766,11 +1712,12 @@ static BOOL init_extra_caps( struct hid_joystick *impl, struct hid_value_caps *c
                              DIDEVICEOBJECTINSTANCEW *instance, void *data )
 {
     struct extra_caps *extra = impl->input_extra_caps + instance->dwOfs / sizeof(LONG);
+    LONG range_max = (instance->dwType & DIDFT_AXIS) ? 65535 : 36000;
     extra->bit_size = caps->bit_size;
     extra->logical_min = caps->logical_min;
     extra->logical_max = caps->logical_max;
-    extra->range_min = caps->physical_min;
-    extra->range_max = caps->physical_max;
+    set_extra_caps_range( impl, instance, 0, range_max );
+    extra->saturation = 10000;
     return DIENUM_CONTINUE;
 }
 
@@ -2039,15 +1986,6 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
             .dwHow = DIPH_DEVICE,
         },
     };
-    DIPROPDWORD saturation =
-    {
-        .diph =
-        {
-            .dwSize = sizeof(DIPROPDWORD),
-            .dwHeaderSize = sizeof(DIPROPHEADER),
-            .dwHow = DIPH_DEVICE,
-        },
-    };
     HIDD_ATTRIBUTES attrs = {.Size = sizeof(attrs)};
     struct hid_preparsed_data *preparsed;
     struct hid_joystick *impl = NULL;
@@ -2147,13 +2085,6 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
     if (FAILED(hr = direct_input_device_init( &impl->base.IDirectInputDevice8W_iface )))
         goto failed;
 
-    range.lMax = 65535;
-    enum_objects( impl, &range.diph, DIDFT_AXIS, set_property_prop_range, &range );
-    range.lMax = 36000;
-    enum_objects( impl, &range.diph, DIDFT_POV, set_property_prop_range, &range );
-    saturation.dwData = 10000;
-    enum_objects( impl, &range.diph, DIDFT_AXIS, set_property_prop_saturation, &saturation );
-
     *out = &impl->base.IDirectInputDevice8W_iface;
     return DI_OK;
 
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index a1764eb64c0..0c2a1b839ff 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -360,6 +360,12 @@ static HRESULT keyboard_internal_get_property( IDirectInputDevice8W *iface, DWOR
     return DIERR_UNSUPPORTED;
 }
 
+static HRESULT keyboard_internal_set_property( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
+                                               const DIDEVICEOBJECTINSTANCEW *instance )
+{
+    return DIERR_UNSUPPORTED;
+}
+
 static const struct dinput_device_vtbl keyboard_internal_vtbl =
 {
     NULL,
@@ -367,6 +373,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl =
     keyboard_internal_unacquire,
     keyboard_internal_enum_objects,
     keyboard_internal_get_property,
+    keyboard_internal_set_property,
 };
 
 static const IDirectInputDevice8WVtbl SysKeyboardWvt =
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index b3a48baa3aa..3553a5af94d 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -691,6 +691,12 @@ static HRESULT mouse_internal_get_property( IDirectInputDevice8W *iface, DWORD p
     return DIERR_UNSUPPORTED;
 }
 
+static HRESULT mouse_internal_set_property( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
+                                            const DIDEVICEOBJECTINSTANCEW *instance )
+{
+    return DIERR_UNSUPPORTED;
+}
+
 static const struct dinput_device_vtbl mouse_internal_vtbl =
 {
     NULL,
@@ -698,6 +704,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl =
     mouse_internal_unacquire,
     mouse_internal_enum_objects,
     mouse_internal_get_property,
+    mouse_internal_set_property,
 };
 
 static const IDirectInputDevice8WVtbl SysMouseWvt =
-- 
2.33.0




More information about the wine-devel mailing list