From 4258f0e79d711cd577e1b2c2882977fff2a4b3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 3 Dec 2021 12:19:04 +0100 Subject: [PATCH] winmm: Fill and return szRegKey when index is -1. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/dinput8/tests/hid.c | 39 --------------------------------------- dlls/winmm/joystick.c | 4 ++++ 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 3eb541364d3..e53afd26337 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -9765,61 +9765,33 @@ static void test_winmm_joystick(void) memset( &caps, 0xcd, sizeof(caps) ); ret = joyGetDevCapsW( -1, (JOYCAPSW *)&caps, sizeof(caps) ); - todo_wine ok( ret == 0, "joyGetDevCapsW returned %u\n", ret ); - todo_wine check_member( caps, expect_regcaps, "%#x", wMid ); - todo_wine check_member( caps, expect_regcaps, "%#x", wPid ); - todo_wine check_member_wstr( caps, expect_regcaps, szPname ); - todo_wine check_member( caps, expect_regcaps, "%#x", wXmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wXmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wYmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wYmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wZmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wZmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wNumButtons ); - todo_wine check_member( caps, expect_regcaps, "%#x", wPeriodMin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wPeriodMax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wRmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wRmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wUmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wUmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wVmin ); - todo_wine check_member( caps, expect_regcaps, "%#x", wVmax ); - todo_wine check_member( caps, expect_regcaps, "%#x", wCaps ); - todo_wine check_member( caps, expect_regcaps, "%#x", wMaxAxes ); - todo_wine check_member( caps, expect_regcaps, "%#x", wNumAxes ); - todo_wine check_member( caps, expect_regcaps, "%#x", wMaxButtons ); - todo_wine check_member_wstr( caps, expect_regcaps, szRegKey ); - todo_wine check_member_wstr( caps, expect_regcaps, szOEMVxD ); - todo_wine check_member_guid( caps, expect_regcaps, ManufacturerGuid ); - todo_wine check_member_guid( caps, expect_regcaps, ProductGuid ); - todo_wine check_member_guid( caps, expect_regcaps, NameGuid ); if (!dinput_driver_start( report_desc, sizeof(report_desc), &hid_caps, NULL, 0 )) goto done; @@ -9849,15 +9821,12 @@ static void test_winmm_joystick(void) check_member( caps, expect_caps, "%#x", wPid ); todo_wine check_member_wstr( caps, expect_caps, szPname ); - todo_wine check_member( caps, expect_caps, "%#x", wXmin ); todo_wine check_member( caps, expect_caps, "%#x", wXmax ); - todo_wine check_member( caps, expect_caps, "%#x", wYmin ); todo_wine check_member( caps, expect_caps, "%#x", wYmax ); - todo_wine check_member( caps, expect_caps, "%#x", wZmin ); todo_wine check_member( caps, expect_caps, "%#x", wZmax ); @@ -9865,15 +9834,12 @@ static void test_winmm_joystick(void) check_member( caps, expect_caps, "%#x", wNumButtons ); check_member( caps, expect_caps, "%#x", wPeriodMin ); check_member( caps, expect_caps, "%#x", wPeriodMax ); - todo_wine check_member( caps, expect_caps, "%#x", wRmin ); todo_wine check_member( caps, expect_caps, "%#x", wRmax ); - todo_wine check_member( caps, expect_caps, "%#x", wUmin ); todo_wine check_member( caps, expect_caps, "%#x", wUmax ); - todo_wine check_member( caps, expect_caps, "%#x", wVmin ); todo_wine check_member( caps, expect_caps, "%#x", wVmax ); @@ -9885,15 +9851,10 @@ static void test_winmm_joystick(void) check_member( caps, expect_caps, "%#x", wNumAxes ); todo_wine check_member( caps, expect_caps, "%#x", wMaxButtons ); - todo_wine check_member_wstr( caps, expect_caps, szRegKey ); - todo_wine check_member_wstr( caps, expect_caps, szOEMVxD ); - todo_wine check_member_guid( caps, expect_caps, ManufacturerGuid ); - todo_wine check_member_guid( caps, expect_caps, ProductGuid ); - todo_wine check_member_guid( caps, expect_caps, NameGuid ); ret = joyGetDevCapsW( 0, (JOYCAPSW *)&caps, sizeof(JOYCAPSW) ); diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index bb8142a29a9..234dd4db594 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -174,6 +174,10 @@ MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetDevCapsW( UINT_PTR id, JOYCAPSW *caps, U if (!caps) return MMSYSERR_INVALPARAM; if (size != sizeof(JOYCAPSW) && size != sizeof(JOYCAPS2W)) return JOYERR_PARMS; + memset( caps, 0, size ); + wcscpy( caps->szRegKey, L"DINPUT.DLL" ); + if (id == ~(UINT_PTR)0) return JOYERR_NOERROR; + if (id >= MAXJOYSTICK) return JOYERR_PARMS; if (!JOY_LoadDriver( id )) return MMSYSERR_NODRIVER;