From 960bb3694143bfd4130229bc7ba7e3d315afa084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 14 Oct 2021 09:39:55 +0200 Subject: [PATCH] joy.cpl: Better handle effect creation errors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51873 Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- dlls/joy.cpl/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 4431669eee8..c96efb17aa3 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -867,6 +867,11 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef) hr = IDirectInputDevice2_CreateEffect( joystick->device, &pdei->guid, &dieffect, &joystick->effects[joystick->cur_effect].effect, NULL); + if (FAILED(hr)) + { + FIXME("Failed to create effect with type %s, hr %#x\n", debugstr_guid(&pdei->guid), hr); + return DIENUM_CONTINUE; + } joystick->effects[joystick->cur_effect].params = dieffect; joystick->effects[joystick->cur_effect].info = *pdei;