- Apply patch from GedMurphy

svn path=/trunk/; revision=31654
This commit is contained in:
Dmitry Chapyshev 2008-01-07 21:08:02 +00:00
parent cd933bb16c
commit 98128b8390

View file

@ -817,27 +817,19 @@ WriteUserLocale(VOID)
HKEY hKey;
LCID lcid;
TCHAR Locale[12];
DWORD dwDisp;
LONG ret = ERROR_SUCCESS;
lcid = GetSystemDefaultLCID();
if (GetLocaleInfo(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)Locale, sizeof(Locale)) != 0)
if (GetLocaleInfo(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, sizeof(Locale) / sizeof(Locale[0])) != 0)
{
if (RegOpenKey(HKEY_CURRENT_USER, L"Control Panel\\International", &hKey) != ERROR_SUCCESS)
if (RegCreateKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\International"),
0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
{
ret = RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Control Panel\\International",
0, NULL, REG_OPTION_NON_VOLATILE,
KEY_WRITE, NULL, &hKey, &dwDisp);
}
if (ret == ERROR_SUCCESS)
{
RegSetValueEx(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (DWORD)(lstrlen(Locale)+1));
RegSetValueEx(hKey, _T("Locale"), 0, REG_SZ, (LPBYTE)Locale, (_tcslen(Locale)+1) * sizeof(TCHAR));
RegCloseKey(hKey);
}
}
RegCloseKey(hKey);
}
static INT_PTR CALLBACK