[1/3] ntdll: Lookup DynamicDST based on current year, instead of year of daylight date.

Sebastian Lackner sebastian at fds-team.de
Mon Aug 3 19:05:05 CDT 2015


When there are no further time changes, the function find_dst_change() will
return (year_end + 1). This patch ensures that we don't lookup the wrong
DynamicDST entry in such a case.

---
 dlls/ntdll/time.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c
index 850d78f..96ffcfa 100644
--- a/dlls/ntdll/time.c
+++ b/dlls/ntdll/time.c
@@ -584,7 +584,7 @@ static BOOL reg_query_value(HKEY hkey, LPCWSTR name, DWORD type, void *data, DWO
     return TRUE;
 }
 
-static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi)
+static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi, int year)
 {
     static const WCHAR Time_ZonesW[] = { 'M','a','c','h','i','n','e','\\',
         'S','o','f','t','w','a','r','e','\\',
@@ -600,7 +600,7 @@ static void find_reg_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi)
     UNICODE_STRING nameW, nameDynamicW;
     WCHAR buf[128], yearW[16];
 
-    sprintfW(yearW, fmtW, tzi->DaylightDate.wYear);
+    sprintfW(yearW, fmtW, year);
 
     attrDynamic.Length = sizeof(attrDynamic);
     attrDynamic.RootDirectory = 0; /* will be replaced later */
@@ -856,7 +856,7 @@ static int init_tz_info(RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi)
             tzi->StandardBias);
     }
 
-    find_reg_tz_info(tzi);
+    find_reg_tz_info(tzi, current_year + 1900);
     cached_tzi = *tzi;
 
     RtlLeaveCriticalSection( &TIME_tz_section );
-- 
2.5.0



More information about the wine-patches mailing list