- Fix definition of KSYSTEM_TIME.
- Set default time zone bias and id in the shared user page.
svn path=/trunk/; revision=11556
#define TIME_NOTIMEMARKER (4)
#define TIME_FORCE24HOURFORMAT (8)
-/* GetTimeZoneInformation */
-#define TIME_ZONE_ID_INVALID ((DWORD) -1)
-#define TIME_ZONE_ID_UNKNOWN (0)
-#define TIME_ZONE_ID_STANDARD (1)
-#define TIME_ZONE_ID_DAYLIGHT (2)
-
/* GetUserObjectInformation */
#define UOI_FLAGS (1)
#define UOI_NAME (2)
typedef struct _KSYSTEM_TIME
{
ULONG LowPart;
- LONG High1Part;
- LONG High2Part;
+ LONG High1Time;
+ LONG High2Time;
} KSYSTEM_TIME, *PKSYSTEM_TIME;
typedef struct _KUSER_SHARED_DATA
#define DOSDEVICE_DRIVE_CDROM 5
#define DOSDEVICE_DRIVE_RAMDISK 6
+/* Values for TimeZoneId */
+#ifndef __USE_W32API
+#define TIME_ZONE_ID_INVALID ((ULONG) -1)
+#define TIME_ZONE_ID_UNKNOWN (0)
+#define TIME_ZONE_ID_STANDARD (1)
+#define TIME_ZONE_ID_DAYLIGHT (2)
+#endif
#define KERNEL_SHARED_DATA (0xFFDF0000)
#define USER_SHARED_DATA (0x7FFE0000)
-/* $Id: sysinfo.c,v 1.57 2004/11/06 01:42:04 weiden Exp $
+/* $Id: sysinfo.c,v 1.58 2004/11/06 16:04:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
if (Size < sizeof (SYSTEM_PROCESSOR_INFORMATION))
{
return (STATUS_INFO_LENGTH_MISMATCH);
- }
+ }
Spi->ProcessorArchitecture = 0; /* Intel Processor */
Spi->ProcessorLevel = ((Ke386Cpuid >> 8) & 0xf);
Spi->ProcessorRevision = (Ke386Cpuid & 0xf) | ((Ke386Cpuid << 4) & 0xf00);
/* Class 3 - Time Of Day Information */
QSI_DEF(SystemTimeOfDayInformation)
{
- LARGE_INTEGER CurrentTime;
+ PSYSTEM_TIMEOFDAY_INFORMATION Sti;
+ LARGE_INTEGER CurrentTime;
- PSYSTEM_TIMEOFDAY_INFORMATION Sti
- = (PSYSTEM_TIMEOFDAY_INFORMATION) Buffer;
+ Sti = (PSYSTEM_TIMEOFDAY_INFORMATION)Buffer;
+ *ReqSize = sizeof (SYSTEM_TIMEOFDAY_INFORMATION);
- *ReqSize = sizeof (SYSTEM_TIMEOFDAY_INFORMATION);
- /*
- * Check user buffer's size
- */
- if (Size < sizeof (SYSTEM_TIMEOFDAY_INFORMATION))
- {
- return (STATUS_INFO_LENGTH_MISMATCH);
- }
+ /* Check user buffer's size */
+ if (Size < sizeof (SYSTEM_TIMEOFDAY_INFORMATION))
+ {
+ return STATUS_INFO_LENGTH_MISMATCH;
+ }
- KeQuerySystemTime(&CurrentTime);
+ KeQuerySystemTime(&CurrentTime);
- Sti->BootTime= SystemBootTime;
- Sti->CurrentTime = CurrentTime;
- Sti->TimeZoneBias.QuadPart = 0; /* FIXME */
- Sti->TimeZoneId = 0; /* FIXME */
- Sti->Reserved = 0; /* FIXME */
+ Sti->BootTime= SystemBootTime;
+ Sti->CurrentTime = CurrentTime;
+ Sti->TimeZoneBias.QuadPart = ExpTimeZoneBias.QuadPart;
+ Sti->TimeZoneId = ExpTimeZoneId;
+ Sti->Reserved = 0;
- return (STATUS_SUCCESS);
+ return STATUS_SUCCESS;
}
/* Class 4 - Path Information */
-/* $Id: time.c,v 1.23 2004/11/05 17:42:20 ekohl Exp $
+/* $Id: time.c,v 1.24 2004/11/06 16:04:58 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* Note: Bias[minutes] = UTC - local time */
TIME_ZONE_INFORMATION ExpTimeZoneInfo;
+LARGE_INTEGER ExpTimeZoneBias;
+ULONG ExpTimeZoneId;
/* FUNCTIONS ****************************************************************/
{
memset(&ExpTimeZoneInfo, 0, sizeof(TIME_ZONE_INFORMATION));
+ ExpTimeZoneBias.QuadPart = (LONGLONG)0;
+ ExpTimeZoneId = TIME_ZONE_ID_UNKNOWN;
}
+ else
+ {
+ /* FIXME: Calculate transition dates */
+
+ ExpTimeZoneBias.QuadPart =
+ ((LONGLONG)(ExpTimeZoneInfo.Bias + ExpTimeZoneInfo.StandardBias)) * TICKSPERMINUTE;
+ ExpTimeZoneId = TIME_ZONE_ID_STANDARD;
+ }
+
+ SharedUserData->TimeZoneBias.High1Time = ExpTimeZoneBias.u.HighPart;
+ SharedUserData->TimeZoneBias.High2Time = ExpTimeZoneBias.u.HighPart;
+ SharedUserData->TimeZoneBias.LowPart = ExpTimeZoneBias.u.LowPart;
+ SharedUserData->TimeZoneId = ExpTimeZoneId;
}
NTSTATUS Status;
LARGE_INTEGER OldSystemTime;
LARGE_INTEGER NewSystemTime;
+ LARGE_INTEGER LocalTime;
TIME_FIELDS TimeFields;
/* FIXME: Check for SeSystemTimePrivilege */
{
KeQuerySystemTime(&OldSystemTime);
}
- RtlTimeToTimeFields (&NewSystemTime, &TimeFields);
- HalSetRealTimeClock (&TimeFields);
+ ExSystemTimeToLocalTime(&NewSystemTime,
+ &LocalTime);
+ RtlTimeToTimeFields(&LocalTime,
+ &TimeFields);
+ HalSetRealTimeClock(&TimeFields);
+
+ /* FIXME: set system time */
+#if 0
+ KeSetSystemTime();
+#endif
if (UnsafeOldSystemTime != NULL)
{
PLARGE_INTEGER SystemTime
)
{
- SystemTime->QuadPart = LocalTime->QuadPart;
+ SystemTime->QuadPart =
+ LocalTime->QuadPart;
#if 0
- +
- ExpTimeZoneInfo.Bias * TICKSPERMINUTE;
+ LocalTime->QuadPart + ExpTimeZoneBias.QuadPart;
#endif
}
PLARGE_INTEGER LocalTime
)
{
- LocalTime->QuadPart = SystemTime->QuadPart;
+ LocalTime->QuadPart =
+ SystemTime->QuadPart;
#if 0
- -
- ExpTimeZoneInfo.Bias * TICKSPERMINUTE;
+ SystemTime->QuadPart - ExpTimeZoneBias.QuadPart;
#endif
}
/* GLOBAL VARIABLES *********************************************************/
-TIME_ZONE_INFORMATION ExpTimeZoneInfo;
+extern TIME_ZONE_INFORMATION ExpTimeZoneInfo;
+extern LARGE_INTEGER ExpTimeZoneBias;
+extern ULONG ExpTimeZoneId;
+
extern POBJECT_TYPE ExEventPairObjectType;
-/* $Id: timer.c,v 1.87 2004/10/31 21:22:06 navaraf Exp $
+/* $Id: timer.c,v 1.88 2004/11/06 16:05:49 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* INCLUDES ***************************************************************/
#include <ntoskrnl.h>
+
#define NDEBUG
#include <internal/debug.h>
}
-/*
- * @implemented
- */
-VOID STDCALL
-KeQuerySystemTime(PLARGE_INTEGER CurrentTime)
/*
* FUNCTION: Gets the current system time
* ARGUMENTS:
* CurrentTime (OUT) = The routine stores the current time here
* NOTE: The time is the number of 100-nanosecond intervals since the
* 1st of January, 1601.
+ *
+ * @implemented
*/
+VOID STDCALL
+KeQuerySystemTime(PLARGE_INTEGER CurrentTime)
{
do
{
- CurrentTime->u.HighPart = SharedUserData->SystemTime.High1Part;
+ CurrentTime->u.HighPart = SharedUserData->SystemTime.High1Time;
CurrentTime->u.LowPart = SharedUserData->SystemTime.LowPart;
}
- while (CurrentTime->u.HighPart != SharedUserData->SystemTime.High2Part);
+ while (CurrentTime->u.HighPart != SharedUserData->SystemTime.High2Time);
}
ULONGLONG STDCALL
do
{
- CurrentTime.u.HighPart = SharedUserData->InterruptTime.High1Part;
+ CurrentTime.u.HighPart = SharedUserData->InterruptTime.High1Time;
CurrentTime.u.LowPart = SharedUserData->InterruptTime.LowPart;
}
- while (CurrentTime.u.HighPart != SharedUserData->InterruptTime.High2Part);
+ while (CurrentTime.u.HighPart != SharedUserData->InterruptTime.High2Time);
return CurrentTime.QuadPart;
}
SharedUserData->TickCountLow = 0;
SharedUserData->TickCountMultiplier = 167783691; // 2^24 * 1193182 / 119310
- SharedUserData->InterruptTime.High2Part = 0;
+ SharedUserData->InterruptTime.High2Time = 0;
SharedUserData->InterruptTime.LowPart = 0;
- SharedUserData->InterruptTime.High1Part = 0;
- SharedUserData->SystemTime.High2Part = SystemBootTime.u.HighPart;
+ SharedUserData->InterruptTime.High1Time = 0;
+ SharedUserData->SystemTime.High2Time = SystemBootTime.u.HighPart;
SharedUserData->SystemTime.LowPart = SystemBootTime.u.LowPart;
- SharedUserData->SystemTime.High1Part = SystemBootTime.u.HighPart;
+ SharedUserData->SystemTime.High1Time = SystemBootTime.u.HighPart;
TimerInitDone = TRUE;
DPRINT("Finished KeInitializeTimerImpl()\n");
KiAcquireSpinLock(&TimerValueLock);
Time.u.LowPart = SharedUserData->InterruptTime.LowPart;
- Time.u.HighPart = SharedUserData->InterruptTime.High1Part;
+ Time.u.HighPart = SharedUserData->InterruptTime.High1Time;
Time.QuadPart += CLOCK_INCREMENT;
- SharedUserData->InterruptTime.High2Part = Time.u.HighPart;
+ SharedUserData->InterruptTime.High2Time = Time.u.HighPart;
SharedUserData->InterruptTime.LowPart = Time.u.LowPart;
- SharedUserData->InterruptTime.High1Part = Time.u.HighPart;
+ SharedUserData->InterruptTime.High1Time = Time.u.HighPart;
Time.u.LowPart = SharedUserData->SystemTime.LowPart;
- Time.u.HighPart = SharedUserData->SystemTime.High1Part;
+ Time.u.HighPart = SharedUserData->SystemTime.High1Time;
Time.QuadPart += CLOCK_INCREMENT;
- SharedUserData->SystemTime.High2Part = Time.u.HighPart;
+ SharedUserData->SystemTime.High2Time = Time.u.HighPart;
SharedUserData->SystemTime.LowPart = Time.u.LowPart;
- SharedUserData->SystemTime.High1Part = Time.u.HighPart;
+ SharedUserData->SystemTime.High1Time = Time.u.HighPart;
/* FIXME: Here we should check for remote debugger break-ins */