Commit 3977ebaf authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

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.
parent 487472b3
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment