[ros-dev] [ros-diffs] [dchapyshev] 33106: - Keyboard layout switching works now in ReactOS!

gedmurphy gedmurphy at gmail.com
Tue Apr 22 22:02:34 CEST 2008


dchapyshev at svn.reactos.org wrote:
> 
> Author: dchapyshev
> Date: Tue Apr 22 14:01:56 2008
> New Revision: 33106
> 
> URL: http://svn.reactos.org/svn/reactos?rev=33106&view=rev
> Log:
> - Keyboard layout switching works now in ReactOS!


Hi, just a few points about this patch.


> +    if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard
> Layout\\Substitutes"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
> +    {
> +        dwBufLen = MAX_PATH;
> +
> +        if (RegQueryValueEx(hKey, szTempLCID, NULL, NULL,
> (LPBYTE)szLCID, &dwBufLen) != ERROR_SUCCESS)


Firstly, Reg functions work on bytes, so you introduced a potential buffer overflow here.
But this is irrelevant due to the next point ;)


> -    Ret = SystemParametersInfo(SPI_SETDEFAULTINPUTLANG, 0, &hKl,
> SPIF_SENDWININICHANGE);
> +	EnumWindows(EnumWindowsProc, (LPARAM) hKl);


This looks like a hack. The original method was correct, it just need implementing in win32k.
Have a look in NtUserSystemParametersInfo.

Thirdly, what is this kbswitch app? It's not a standard windows tool, yet it's included in our base.
Keyboard switching is done in intl.cpl, or via ctfmon (which we don't yet have) on a per app basis.

Regards,
Ged.





More information about the Ros-dev mailing list