Author: hbelusca Date: Fri Apr 21 00:22:39 2017 New Revision: 74385
URL: http://svn.reactos.org/svn/reactos?rev=74385&view=rev Log: [INPUT.CPL] - Remove an unneeded header inclusion; - Fix a sizeof invocation; - RegEnumKeyExW and RegEnumValueW take their fourth parameter (size of key / value name, resp.) as a size in number of *characters* (and not in number of bytes); - Add a missing RegCloseKey call in LocaleList_Create.
Modified: trunk/reactos/dll/cpl/input/input.h trunk/reactos/dll/cpl/input/key_settings_dialog.c trunk/reactos/dll/cpl/input/layout_list.c trunk/reactos/dll/cpl/input/locale_list.c
Modified: trunk/reactos/dll/cpl/input/input.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.h?rev=7... ============================================================================== --- trunk/reactos/dll/cpl/input/input.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/input.h [iso-8859-1] Fri Apr 21 00:22:39 2017 @@ -1,7 +1,8 @@ #ifndef _INPUT_H #define _INPUT_H
-#include <stdarg.h> +#include <stdlib.h> +#include <wchar.h>
#define WIN32_NO_STATUS #include <windef.h> @@ -13,9 +14,7 @@ #include <commctrl.h> #include <windowsx.h> #include <setupapi.h> -#include <wchar.h> #include <strsafe.h> -#include <stdlib.h>
#include "resource.h"
Modified: trunk/reactos/dll/cpl/input/key_settings_dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/key_settings_... ============================================================================== --- trunk/reactos/dll/cpl/input/key_settings_dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/key_settings_dialog.c [iso-8859-1] Fri Apr 21 00:22:39 2017 @@ -22,9 +22,7 @@ KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { - DWORD dwSize; - - dwSize = sizeof(dwSize); + DWORD dwSize = sizeof(dwAttributes);
RegQueryValueExW(hKey, L"Attributes",
Modified: trunk/reactos/dll/cpl/input/layout_list.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/layout_list.c... ============================================================================== --- trunk/reactos/dll/cpl/input/layout_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/layout_list.c [iso-8859-1] Fri Apr 21 00:22:39 2017 @@ -104,7 +104,7 @@ return; }
- dwSize = sizeof(szLayoutId); + dwSize = ARRAYSIZE(szLayoutId);
while (RegEnumKeyExW(hKey, dwIndex, szLayoutId, &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) @@ -230,7 +230,7 @@ RegCloseKey(hLayoutKey); }
- dwSize = sizeof(szLayoutId); + dwSize = ARRAYSIZE(szLayoutId); ++dwIndex; }
Modified: trunk/reactos/dll/cpl/input/locale_list.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/locale_list.c... ============================================================================== --- trunk/reactos/dll/cpl/input/locale_list.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/input/locale_list.c [iso-8859-1] Fri Apr 21 00:22:39 2017 @@ -97,7 +97,7 @@ return NULL; }
- dwSize = sizeof(szValue); + dwSize = ARRAYSIZE(szValue); dwIndex = 0;
while (RegEnumValueW(hKey, dwIndex, szValue, &dwSize, @@ -115,9 +115,11 @@ LocaleList_Append(dwId, szName); }
- dwSize = sizeof(szValue); + dwSize = ARRAYSIZE(szValue); ++dwIndex; } + + RegCloseKey(hKey);
return _LocaleList; }