21#define TICKSPERMIN 600000000
23#define LL2FILETIME( ll, pft )\
24 (pft)->dwLowDateTime = (UINT)(ll); \
25 (pft)->dwHighDateTime = (UINT)((ll) >> 32);
26#define FILETIME2LL( pft, ll) \
27 ll = (((LONGLONG)((pft)->dwHighDateTime))<<32) + (pft)-> dwLowDateTime ;
31 { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
32 { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
39 return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0;
61 int limit_day, dayinsecs;
72 if (compareDate->
wYear == 0)
77 int weekofmonth = compareDate->
wDay;
81 limit_day =
First + 7 * (weekofmonth - 1);
89 limit_day = compareDate->
wDay;
93 limit_day = ((limit_day * 24 + compareDate->
wHour) * 60 +
95 dayinsecs = ((
date->wDay * 24 +
date->wHour) * 60 +
96 date->wMinute ) * 60 +
date->wSecond;
98 return dayinsecs < limit_day ? -1 :
99 dayinsecs > limit_day ? 1 :
124 BOOL beforeStandardDate, afterDaylightDate;
150 lpFileTime = &ftTemp;
154 year = SysTime.
wYear;
163 if(year == SysTime.
wYear) {
168 beforeStandardDate =
ret < 0;
170 beforeStandardDate = SysTime.
wYear < year;
179 if(year == SysTime.
wYear) {
184 afterDaylightDate =
ret >= 0;
186 afterDaylightDate = SysTime.
wYear > year;
191 if( beforeStandardDate && afterDaylightDate )
194 if( beforeStandardDate || afterDaylightDate )
267 DPRINT(
"GetTimeZoneInformation()\n");
270 &TimeZoneInformation,
321 DPRINT(
"SetTimeZoneInformation()\n");
354 DPRINT1(
"RtlSetTimeZoneInformation() failed (Status %lx)\n",
Status);
360 (
PVOID)&TimeZoneInformation,
364 DPRINT1(
"NtSetSystemInformation() failed (Status %lx)\n",
Status);
NTSYSAPI NTSTATUS NTAPI NtSetSystemInformation(IN INT SystemInformationClass, IN PVOID SystemInformation, IN ULONG SystemInformationLength)
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
static int TIME_DayLightCompareDate(const SYSTEMTIME *date, const SYSTEMTIME *compareDate)
BOOL WINAPI TzSpecificLocalTimeToSystemTime(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpLocalTime, LPSYSTEMTIME lpUniversalTime)
BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpUniversalTime, LPSYSTEMTIME lpLocalTime)
#define FILETIME2LL(pft, ll)
static BOOL TIME_GetTimezoneBias(const TIME_ZONE_INFORMATION *pTZinfo, FILETIME *lpFileTime, BOOL islocal, LONG *pBias)
#define LL2FILETIME(ll, pft)
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
static DWORD TIME_CompTimeZoneID(const TIME_ZONE_INFORMATION *pTZinfo, FILETIME *lpFileTime, BOOL islocal)
static DWORD TIME_ZoneID(const TIME_ZONE_INFORMATION *pTzi)
static const int MonthLengths[2][12]
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
@ SystemCurrentTimeZoneInformation
NTSYSAPI NTSTATUS NTAPI RtlSetTimeZoneInformation(_In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
#define TIME_ZONE_ID_UNKNOWN
#define TIME_ZONE_ID_STANDARD
#define TIME_ZONE_ID_DAYLIGHT
DWORD BaseSetLastNTError(IN NTSTATUS Status)
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
WINBASEAPI _In_ CONST SYSTEMTIME _Out_ LPSYSTEMTIME lpLocalTime
#define TIME_ZONE_ID_INVALID
WINBASEAPI _Out_ PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation
WINBASEAPI _In_ CONST SYSTEMTIME * lpUniversalTime