Author: akhaldi Date: Sat May 2 19:48:26 2015 New Revision: 67516
URL: http://svn.reactos.org/svn/reactos?rev=67516&view=rev Log: [SYSSETUP] Fix timezone setup in the unattended install of ReactOS. Spotted and fixed by V. CORE-9648
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/wizard.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.c... ============================================================================== --- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sat May 2 19:48:26 2015 @@ -1219,27 +1219,36 @@ BOOL bFound = FALSE; unsigned long iLanguageID;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SYSTEM\CurrentControlSet\Control\NLS\Language", - 0, - KEY_ALL_ACCESS, - &hKey)) - return FALSE; - - dwValueSize = 9 * sizeof(WCHAR); - if (RegQueryValueExW(hKey, - L"Default", - NULL, - NULL, - (LPBYTE)szLanguageIdString, - &dwValueSize)) - { + if (*lpIndex == -1) + { + *lpIndex = 85; /* fallback to GMT time zone */ + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\CurrentControlSet\Control\NLS\Language", + 0, + KEY_ALL_ACCESS, + &hKey)) + return FALSE; + + dwValueSize = 9 * sizeof(WCHAR); + if (RegQueryValueExW(hKey, + L"Default", + NULL, + NULL, + (LPBYTE)szLanguageIdString, + &dwValueSize)) + { + RegCloseKey(hKey); + return FALSE; + } + + iLanguageID = wcstoul(szLanguageIdString, NULL, 16); RegCloseKey(hKey); - return FALSE; - } - - iLanguageID = wcstoul(szLanguageIdString, NULL, 16); - RegCloseKey(hKey); + } + else + { + iLanguageID = *lpIndex; + }
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones", @@ -1515,7 +1524,7 @@ else { ShowTimeZoneList(GetDlgItem(hwndDlg, IDC_TIMEZONELIST), - SetupData, 85 /* GMT time zone */); + SetupData, -1);
SendDlgItemMessage(hwndDlg, IDC_AUTODAYLIGHT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); }