mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 09:21:31 +00:00
[NTOS:EX] Add some missing PoNotifySystemTimeSet() calls. Stub out NtSetSystemTime() with NULL parameter.
- They notify, via the "\\Callback\\SetSystemTime" callback, components of a change of system time (for example, Win32k). Note, that our Win32k currently does not handle power callouts, so it isn't affected by these changes (yet). - NtSetSystemTime(NULL, ...) means "update system time using the current time-zone information", which is something we don't implement yet. (And, nothing was previously protecting this call from a NULL parameter...)
This commit is contained in:
parent
4814dfea01
commit
c66a1582ac
|
@ -1549,10 +1549,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
||||||
ExpTimeZoneBias.QuadPart;
|
ExpTimeZoneBias.QuadPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the system time */
|
/* Update the system time and notify the system */
|
||||||
KeSetSystemTime(&UniversalBootTime, &OldTime, FALSE, NULL);
|
KeSetSystemTime(&UniversalBootTime, &OldTime, FALSE, NULL);
|
||||||
|
|
||||||
/* Do system callback */
|
|
||||||
PoNotifySystemTimeSet();
|
PoNotifySystemTimeSet();
|
||||||
|
|
||||||
/* Remember this as the boot time */
|
/* Remember this as the boot time */
|
||||||
|
@ -1681,7 +1679,8 @@ Phase1InitializationDiscard(IN PVOID Context)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Check if the timezone switched and update the time */
|
/* Check if the timezone switched and update the time */
|
||||||
if (LastTzBias != ExpLastTimeZoneBias) ZwSetSystemTime(NULL, NULL);
|
if (LastTzBias != ExpLastTimeZoneBias)
|
||||||
|
ZwSetSystemTime(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the File System Runtime Library */
|
/* Initialize the File System Runtime Library */
|
||||||
|
|
|
@ -372,8 +372,9 @@ ExpSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
/* Calculate the new system time */
|
/* Calculate the new system time */
|
||||||
ExLocalTimeToSystemTime(&LocalTime, &SystemTime);
|
ExLocalTimeToSystemTime(&LocalTime, &SystemTime);
|
||||||
|
|
||||||
/* Set the new system time */
|
/* Set the new system time and notify the system */
|
||||||
KeSetSystemTime(&SystemTime, &OldTime, FALSE, NULL);
|
KeSetSystemTime(&SystemTime, &OldTime, FALSE, NULL);
|
||||||
|
PoNotifySystemTimeSet();
|
||||||
|
|
||||||
/* Return success */
|
/* Return success */
|
||||||
DPRINT("ExpSetTimeZoneInformation() done\n");
|
DPRINT("ExpSetTimeZoneInformation() done\n");
|
||||||
|
@ -400,8 +401,17 @@ NtSetSystemTime(IN PLARGE_INTEGER SystemTime,
|
||||||
TIME_FIELDS TimeFields;
|
TIME_FIELDS TimeFields;
|
||||||
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
// TODO: Handle the case when SystemTime == NULL, which means:
|
||||||
|
// "update system time using the current time-zone information".
|
||||||
|
if (!SystemTime)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if we were called from user-mode */
|
/* Check if we were called from user-mode */
|
||||||
if (PreviousMode != KernelMode)
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +419,7 @@ NtSetSystemTime(IN PLARGE_INTEGER SystemTime,
|
||||||
{
|
{
|
||||||
/* Verify the time pointers */
|
/* Verify the time pointers */
|
||||||
NewSystemTime = ProbeForReadLargeInteger(SystemTime);
|
NewSystemTime = ProbeForReadLargeInteger(SystemTime);
|
||||||
if(PreviousTime) ProbeForWriteLargeInteger(PreviousTime);
|
if (PreviousTime) ProbeForWriteLargeInteger(PreviousTime);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -437,8 +447,9 @@ NtSetSystemTime(IN PLARGE_INTEGER SystemTime,
|
||||||
RtlTimeToTimeFields(&LocalTime, &TimeFields);
|
RtlTimeToTimeFields(&LocalTime, &TimeFields);
|
||||||
HalSetRealTimeClock(&TimeFields);
|
HalSetRealTimeClock(&TimeFields);
|
||||||
|
|
||||||
/* Now set system time */
|
/* Now set the system time and notify the system */
|
||||||
KeSetSystemTime(&NewSystemTime, &OldSystemTime, FALSE, NULL);
|
KeSetSystemTime(&NewSystemTime, &OldSystemTime, FALSE, NULL);
|
||||||
|
PoNotifySystemTimeSet();
|
||||||
|
|
||||||
/* Check if caller wanted previous time */
|
/* Check if caller wanted previous time */
|
||||||
if (PreviousTime)
|
if (PreviousTime)
|
||||||
|
|
Loading…
Reference in a new issue