Rémi Bernon : joy.cpl: Read the effect DIEFFECTINFOW instead of storing it.
Module: wine Branch: master Commit: 1c94551ef8b6fd0322f989992a8d2dc62abd74f7 URL: https://gitlab.winehq.org/wine/wine/-/commit/1c94551ef8b6fd0322f989992a8d2dc... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Nov 26 20:19:55 2022 +0100 joy.cpl: Read the effect DIEFFECTINFOW instead of storing it. --- dlls/joy.cpl/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 53cfff1baf3..b32e1f18152 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -71,7 +71,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(joycpl); struct Effect { IDirectInputEffect *effect; - DIEFFECTINFOW info; }; struct Joystick @@ -216,7 +215,6 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) } joystick->effects[joystick->cur_effect].effect = effect; - joystick->effects[joystick->cur_effect].info = *info; joystick->cur_effect += 1; return DIENUM_CONTINUE; @@ -866,9 +864,12 @@ static void initialize_effects_list(HWND hwnd, struct Joystick* joy) for (i=0; i < joy->num_effects; i++) { - /* Effect names start with GUID_, so we'll skip this part */ - WCHAR *name = joy->effects[i].info.tszName + 5; - SendDlgItemMessageW(hwnd, IDC_FFEFFECTLIST, LB_ADDSTRING, 0, (LPARAM) name); + DIEFFECTINFOW info = {.dwSize = sizeof(DIEFFECTINFOW)}; + GUID guid; + + if (FAILED(IDirectInputEffect_GetEffectGuid( joy->effects[i].effect, &guid ))) continue; + if (FAILED(IDirectInputDevice8_GetEffectInfo( joy->device, &info, &guid ))) continue; + SendDlgItemMessageW(hwnd, IDC_FFEFFECTLIST, LB_ADDSTRING, 0, (LPARAM)(info.tszName + 5)); } }
participants (1)
-
Alexandre Julliard