Having to pass the size separately made the function unnecessarily complicated.
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/joy.cpl/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 28334ec6f99..7d724be7280 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -123,7 +123,7 @@ static BOOL get_app_key(HKEY *defkey, HKEY *appkey) * set_config_key [internal] * Writes a string value to a registry key, deletes the key if value == NULL */ -static DWORD set_config_key(HKEY defkey, HKEY appkey, const WCHAR *name, const WCHAR *value, DWORD size) +static DWORD set_config_key(HKEY defkey, HKEY appkey, const WCHAR *name, const WCHAR *value) { if (value == NULL) { @@ -135,6 +135,8 @@ static DWORD set_config_key(HKEY defkey, HKEY appkey, const WCHAR *name, const W } else { + DWORD size = wcslen(value); + if (appkey && !RegSetValueExW(appkey, name, 0, REG_SZ, (const BYTE*) value, (size + 1)*sizeof(WCHAR))) return 0;
@@ -157,9 +159,9 @@ static void enable_joystick(WCHAR *joy_name, BOOL enable) get_app_key(&hkey, &appkey);
if (!enable) - set_config_key(hkey, appkey, joy_name, L"disabled", wcslen(L"disabled")); + set_config_key(hkey, appkey, joy_name, L"disabled"); else - set_config_key(hkey, appkey, joy_name, NULL, 0); + set_config_key(hkey, appkey, joy_name, NULL);
if (hkey) RegCloseKey(hkey); if (appkey) RegCloseKey(appkey); @@ -230,9 +232,9 @@ static void override_joystick(WCHAR *joy_name, BOOL override) get_app_key(&hkey, &appkey);
if (override) - set_config_key(hkey, appkey, joy_name, L"override", wcslen(L"override")); + set_config_key(hkey, appkey, joy_name, L"override"); else - set_config_key(hkey, appkey, joy_name, NULL, 0); + set_config_key(hkey, appkey, joy_name, NULL);
if (hkey) RegCloseKey(hkey); if (appkey) RegCloseKey(appkey);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=136323
Your paranoid android.
=== debian11b (64 bit WoW report) ===
qasf: asfreader.c:947: Test failed: blocking 0: Got hr 0x80040216.
Report validation errors: qasf:asfreader crashed (c0000005)
This merge request was approved by Rémi Bernon.