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.
This commit is contained in:
Sebastian Lackner 2015-08-04 02:05:05 +02:00 committed by Alexandre Julliard
parent 487472b3f6
commit 3977ebafc0

View file

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