From: Sebastian Lackner Subject: [1/3] ntdll: Lookup DynamicDST based on current year, instead of year of daylight date. Message-Id: <55C001B1.3050306@fds-team.de> Date: Tue, 4 Aug 2015 02:05:05 +0200 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