Sebastian Lackner : ntdll: Lookup DynamicDST based on current year, instead of year of daylight date.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 5 10:28:03 CDT 2015


Module: wine
Branch: master
Commit: 3977ebafc068cf0115df4d6fc22f1d2823e04a13
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3977ebafc068cf0115df4d6fc22f1d2823e04a13

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Aug  4 02:05:05 2015 +0200

ntdll: Lookup DynamicDST based on current year, instead of year of daylight date.

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 );




More information about the wine-cvs mailing list