Author: ekohl
Date: Sat Oct 20 19:03:15 2007
New Revision: 29713
URL:
http://svn.reactos.org/svn/reactos?rev=29713&view=rev
Log:
Make it UNICODE-safe.
Modified:
trunk/reactos/dll/cpl/input/add.c
trunk/reactos/dll/cpl/input/input.rbuild
trunk/reactos/dll/cpl/input/input.rc
trunk/reactos/dll/cpl/input/misc.c
trunk/reactos/dll/cpl/input/settings.c
Modified: trunk/reactos/dll/cpl/input/add.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/add.c?rev=29…
==============================================================================
--- trunk/reactos/dll/cpl/input/add.c (original)
+++ trunk/reactos/dll/cpl/input/add.c Sat Oct 20 19:03:15 2007
@@ -72,20 +72,20 @@
{
LCID Lcid;
TCHAR Lang[1024];
- int Index;
+ INT Index;
- Lcid = wcstoul(lpLanguage, NULL, 16);
+ Lcid = _tcstoul(lpLanguage, NULL, 16);
GetLocaleInfo(Lcid, LOCALE_SLANGUAGE, Lang, sizeof(Lang));
- Index = (int) SendMessage(hLanguageList,
- CB_ADDSTRING,
- 0,
- (LPARAM)Lang);
+ Index = (INT)SendMessage(hLanguageList,
+ CB_ADDSTRING,
+ 0,
+ (LPARAM)Lang);
SendMessage(hLanguageList,
- CB_SETITEMDATA,
- Index,
- (LPARAM)Lcid);
+ CB_SETITEMDATA,
+ Index,
+ (LPARAM)Lcid);
return TRUE;
}
@@ -96,13 +96,14 @@
CreateLanguagesList(HWND hWnd)
{
TCHAR LangSel[256];
+
hLanguageList = hWnd;
EnumSystemLocales(LanguagesEnumProc, LCID_INSTALLED);
LoadString(hApplet,
IDS_SELECTED_LANGUAGE,
LangSel,
- sizeof(LangSel) / sizeof(TCHAR));
+ 256);
SendMessage(hLanguageList,
CB_SELECTSTRING,
@@ -119,7 +120,7 @@
LoadString(hApplet,
IDS_SELECTED_LAYOUT,
Layout,
- sizeof(Layout) / sizeof(TCHAR));
+ 256);
SendMessage(hWnd,
CB_SELECTSTRING,
(WPARAM) -1,
Modified: trunk/reactos/dll/cpl/input/input.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.rbuild…
==============================================================================
--- trunk/reactos/dll/cpl/input/input.rbuild (original)
+++ trunk/reactos/dll/cpl/input/input.rbuild Sat Oct 20 19:03:15 2007
@@ -1,10 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="input" type="win32dll" extension=".dll"
baseaddress="${BASEADDRESS_INPUT}" installbase="system32"
installname="input.dll">
+<module name="input" type="win32dll" extension=".dll"
baseaddress="${BASEADDRESS_INPUT}" installbase="system32"
installname="input.dll" unicode="yes">
<importlibrary definition="input.def" />
<include base="input">.</include>
- <define name="UNICODE" />
- <define name="_UNICODE" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
Modified: trunk/reactos/dll/cpl/input/input.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.rc?rev…
==============================================================================
--- trunk/reactos/dll/cpl/input/input.rc (original)
+++ trunk/reactos/dll/cpl/input/input.rc Sat Oct 20 19:03:15 2007
@@ -21,6 +21,4 @@
IDI_KEY_SHORT_ICO ICON "resources/keyboard-shortcuts.ico"
IDI_INFO_ICO ICON "resources/information.ico"
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
#include "rsrc.rc"
Modified: trunk/reactos/dll/cpl/input/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/misc.c?rev=2…
==============================================================================
--- trunk/reactos/dll/cpl/input/misc.c (original)
+++ trunk/reactos/dll/cpl/input/misc.c Sat Oct 20 19:03:15 2007
@@ -43,7 +43,7 @@
CreateKeyboardLayoutList(HWND hWnd)
{
TCHAR Layout[256];
- int Index;
+ INT Index;
UINT loIndex;
for (loIndex = BEGIN_LAYOUT; loIndex <= END_LAYOUT; loIndex++)
@@ -51,12 +51,12 @@
LoadString(hApplet,
loIndex,
Layout,
- sizeof(Layout) / sizeof(TCHAR));
+ 256);
- if (strlen((char*)Layout) > 0)
+ if (_tcslen(Layout) > 0)
{
Index = (int) SendMessage(hWnd,
- CB_INSERTSTRING,
+ CB_ADDSTRING,
0,
(LPARAM)Layout);
Modified: trunk/reactos/dll/cpl/input/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/settings.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/input/settings.c (original)
+++ trunk/reactos/dll/cpl/input/settings.c Sat Oct 20 19:03:15 2007
@@ -46,10 +46,14 @@
CreateDefaultLangList(HWND hWnd)
{
HKEY hKey;
- char szPreload[BUFSIZE],szCount[BUFSIZE],Lang[BUFSIZE];
- DWORD dwBufLen = BUFSIZE, dwBufCLen = BUFSIZE, cValues;
+ TCHAR szPreload[BUFSIZE];
+ TCHAR szCount[BUFSIZE];
+ TCHAR Lang[BUFSIZE];
+ DWORD dwBufLen;
+ DWORD dwBufCLen;
+ DWORD cValues;
LONG lRet;
- int Count;
+ INT Count;
LCID Lcid;
if(RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Keyboard Layout\\Preload"), 0,
KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
@@ -63,13 +67,17 @@
{
for (Count = 0; Count < cValues; Count++)
{
- szCount[0] = '\0';
+ szCount[0] = TEXT('\0');
+
+ dwBufCLen = BUFSIZE;
lRet =
RegEnumValue(hKey,Count,(LPTSTR)szCount,&dwBufCLen,NULL,NULL,NULL,NULL);
- sprintf(szCount,"%d",Count + 1);
+ _stprintf(szCount,TEXT("%d"),Count + 1);
+
+ dwBufLen = BUFSIZE;
RegQueryValueEx(hKey,(LPTSTR)szCount,NULL,NULL,(LPBYTE)szPreload,&dwBufLen);
- Lcid = wcstoul((LPTSTR)szPreload, NULL, 16);
+ Lcid = _tcstoul(szPreload, NULL, 16);
GetLocaleInfo(Lcid, LOCALE_SLANGUAGE, (LPTSTR)Lang, sizeof(Lang));
SendMessage(hWnd,