From b3861e72ec527e73bcbb44978e531f5731237c0c Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 5 Jun 2007 01:28:37 +0000 Subject: try to override timezone list index by matching timezone name (list index inconsistent accross versions of windows) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@199 4f64403b-2f21-0410-a795-97e2b3489a10 --- worldtime_protocol/timezone.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'worldtime_protocol/timezone.cpp') diff --git a/worldtime_protocol/timezone.cpp b/worldtime_protocol/timezone.cpp index ee4a8ed..5b2c31b 100644 --- a/worldtime_protocol/timezone.cpp +++ b/worldtime_protocol/timezone.cpp @@ -19,7 +19,6 @@ bool build_timezone_list() { DWORD dwcbDLT; LS_TZREG Temp; FILETIME ftLastWrite; - unsigned int list_index = 0; bool win9x = false; if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TZREG, 0, KEY_ENUMERATE_SUB_KEYS, &HKlmtz) != ERROR_SUCCESS) { @@ -28,7 +27,7 @@ bool build_timezone_list() { return false; } - while(RegEnumKeyEx(HKlmtz, dwIndex++, tcName, &dwcbName, NULL, NULL, NULL, &ftLastWrite) != ERROR_NO_MORE_ITEMS) { + while(RegEnumKeyEx(HKlmtz, dwIndex, tcName, &dwcbName, NULL, NULL, NULL, &ftLastWrite) != ERROR_NO_MORE_ITEMS) { if(RegOpenKeyEx(HKlmtz, tcName, 0,KEY_QUERY_VALUE, &KKtz) != ERROR_SUCCESS) { RegCloseKey(HKlmtz); @@ -53,11 +52,11 @@ bool build_timezone_list() { RegCloseKey(KKtz); - Temp.list_index = list_index; + Temp.list_index = dwIndex; timezone_list.push_back(Temp); dwcbName = MAX_SIZE; - list_index++; + dwIndex++; } RegCloseKey(HKlmtz); -- cgit v1.2.3