Author: cwittich
Date: Wed Feb 19 21:01:25 2014
New Revision: 62260
URL:
http://svn.reactos.org/svn/reactos?rev=62260&view=rev
Log:
[kernel32]
sync TIME_CompTimeZoneID with wine 1.7.11
Modified:
trunk/reactos/dll/win32/kernel32/wine/timezone.c
Modified: trunk/reactos/dll/win32/kernel32/wine/timezone.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/wine/ti…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/wine/timezone.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/wine/timezone.c [iso-8859-1] Wed Feb 19 21:01:25
2014
@@ -120,7 +120,7 @@
DWORD
TIME_CompTimeZoneID( const TIME_ZONE_INFORMATION *pTZinfo, FILETIME *lpFileTime, BOOL
islocal )
{
- int ret;
+ int ret, year;
BOOL beforeStandardDate, afterDaylightDate;
DWORD retval = TIME_ZONE_ID_INVALID;
LONGLONG llTime = 0; /* initialized to prevent gcc complaining */
@@ -145,20 +145,29 @@
if (!islocal) {
FILETIME2LL( lpFileTime, llTime );
- llTime -= ( pTZinfo->Bias + pTZinfo->DaylightBias )
- * (LONGLONG)TICKSPERMIN;
+ llTime -= pTZinfo->Bias * (LONGLONG)TICKSPERMIN;
LL2FILETIME( llTime, &ftTemp)
lpFileTime = &ftTemp;
}
FileTimeToSystemTime(lpFileTime, &SysTime);
+ year = SysTime.wYear;
+
+ if (!islocal) {
+ llTime -= pTZinfo->DaylightBias * (LONGLONG)TICKSPERMIN;
+ LL2FILETIME( llTime, &ftTemp)
+ FileTimeToSystemTime(lpFileTime, &SysTime);
+ }
- /* check for daylight savings */
- ret = TIME_DayLightCompareDate( &SysTime, &pTZinfo->StandardDate);
- if (ret == -2)
- return TIME_ZONE_ID_INVALID;
-
- beforeStandardDate = ret < 0;
+ /* check for daylight savings */
+ if(year == SysTime.wYear) {
+ ret = TIME_DayLightCompareDate( &SysTime,
&pTZinfo->StandardDate);
+ if (ret == -2)
+ return TIME_ZONE_ID_INVALID;
+
+ beforeStandardDate = ret < 0;
+ } else
+ beforeStandardDate = SysTime.wYear < year;
if (!islocal) {
llTime -= ( pTZinfo->StandardBias - pTZinfo->DaylightBias )
@@ -167,11 +176,14 @@
FileTimeToSystemTime(lpFileTime, &SysTime);
}
- ret = TIME_DayLightCompareDate( &SysTime, &pTZinfo->DaylightDate);
- if (ret == -2)
- return TIME_ZONE_ID_INVALID;
-
- afterDaylightDate = ret >= 0;
+ if(year == SysTime.wYear) {
+ ret = TIME_DayLightCompareDate( &SysTime,
&pTZinfo->DaylightDate);
+ if (ret == -2)
+ return TIME_ZONE_ID_INVALID;
+
+ afterDaylightDate = ret >= 0;
+ } else
+ afterDaylightDate = SysTime.wYear > year;
retval = TIME_ZONE_ID_STANDARD;
if( pTZinfo->DaylightDate.wMonth < pTZinfo->StandardDate.wMonth ) {