From e242dc3f08b2eaa08e250f55e32f3d1ca13844ce Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 2 May 2015 19:48:26 +0000 Subject: [PATCH] [SYSSETUP] Fix timezone setup in the unattended install of ReactOS. Spotted and fixed by V. CORE-9648 svn path=/trunk/; revision=67516 --- reactos/dll/win32/syssetup/wizard.c | 47 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 51230bc3083..b8699309c90 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -1219,27 +1219,36 @@ GetTimeZoneListIndex(LPDWORD lpIndex) 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 @@ DateTimePageDlgProc(HWND hwndDlg, else { ShowTimeZoneList(GetDlgItem(hwndDlg, IDC_TIMEZONELIST), - SetupData, 85 /* GMT time zone */); + SetupData, -1); SendDlgItemMessage(hwndDlg, IDC_AUTODAYLIGHT, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); } -- 2.17.1