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

gedmurphy gedmurphy at gmail.com
Wed Apr 23 15:50:44 CEST 2008


Just to clarify to anyone following this thread, the change from SystemParametersInfo to sending a message isn't incorrect.
kbswitch is meant to be a sort of makeshift ctfmon.exe, and isn't meant for switching keyboards system-wide as intl.cpl does.

The buffer overflow problems still stand though.

Ged.


> -----Original Message-----
> From: gedmurphy [mailto:gedmurphy at gmail.com]
> Sent: 22 April 2008 21:03
> To: 'ros-dev at reactos.org'
> Subject: RE: [ros-diffs] [dchapyshev] 33106: - Keyboard layout
> switching works now in ReactOS!
> 
> 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