ReactOS 0.4.17-dev-116-ga4b6fe9
time.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel
4 * FILE: ntoskrnl/ex/time.c
5 * PURPOSE: Time and Timezone Management
6 * PROGRAMMERS: Eric Kohl
7 * Thomas Weidenmueller
8 */
9
10/* INCLUDES *****************************************************************/
11
12#include <ntoskrnl.h>
13#define NDEBUG
14#include <debug.h>
15
16#define TICKSPERMINUTE 600000000
17
18/* GLOBALS ******************************************************************/
19
20/* Note: Bias[minutes] = UTC - local time */
30
31/* FUNCTIONS ****************************************************************/
32
33/*++
34 * If successful, this function sets the following global variable:
35 * ExpTimeZoneInfo
36 *--*/
37static
40 _In_ PLARGE_INTEGER TimeNow,
41 _Out_ PULONG TimeZoneId,
42 _Out_ PLARGE_INTEGER NewTimeZoneBias)
43{
44 LARGE_INTEGER StandardTime;
45 LARGE_INTEGER DaylightTime;
46 LARGE_INTEGER LocalTimeNow = *TimeNow;
48
49 DPRINT("ExpGetTimeZoneId\n");
50
51 /* Read time zone information from the registry */
53 if (!NT_SUCCESS(Status))
54 {
55 DPRINT1("RtlQueryTimeZoneInformation failed (Status 0x%08lx)\n", Status);
56 return FALSE;
57 }
58
59 /* Get the default bias */
60 NewTimeZoneBias->QuadPart = (LONGLONG)ExpTimeZoneInfo.Bias * TICKSPERMINUTE;
61
64 {
65 /* Get this year's standard start time */
67 &StandardTime,
68 &LocalTimeNow,
69 TRUE))
70 {
71 DPRINT1("RtlCutoverTimeToSystemTime for StandardDate failed\n");
72 return FALSE;
73 }
74
75 /* Get this year's daylight start time */
77 &DaylightTime,
78 &LocalTimeNow,
79 TRUE))
80 {
81 DPRINT1("RtlCutoverTimeToSystemTime for DaylightDate failed\n");
82 return FALSE;
83 }
84
85 /* Determine the time zone id and update the time zone bias */
86 if (DaylightTime.QuadPart < StandardTime.QuadPart)
87 {
88 if ((LocalTimeNow.QuadPart >= DaylightTime.QuadPart) &&
89 (LocalTimeNow.QuadPart < StandardTime.QuadPart))
90 {
91 DPRINT("Daylight time\n");
92 *TimeZoneId = TIME_ZONE_ID_DAYLIGHT;
93 NewTimeZoneBias->QuadPart += (LONGLONG)ExpTimeZoneInfo.DaylightBias * TICKSPERMINUTE;
94 }
95 else
96 {
97 DPRINT("Standard time\n");
98 *TimeZoneId = TIME_ZONE_ID_STANDARD;
99 NewTimeZoneBias->QuadPart += (LONGLONG)ExpTimeZoneInfo.StandardBias * TICKSPERMINUTE;
100 }
101 }
102 else
103 {
104 if ((LocalTimeNow.QuadPart >= StandardTime.QuadPart) &&
105 (LocalTimeNow.QuadPart < DaylightTime.QuadPart))
106 {
107 DPRINT("Standard time\n");
108 *TimeZoneId = TIME_ZONE_ID_STANDARD;
109 NewTimeZoneBias->QuadPart += (LONGLONG)ExpTimeZoneInfo.StandardBias * TICKSPERMINUTE;
110 }
111 else
112 {
113 DPRINT("Daylight time\n");
114 *TimeZoneId = TIME_ZONE_ID_DAYLIGHT;
115 NewTimeZoneBias->QuadPart += (LONGLONG)ExpTimeZoneInfo.DaylightBias * TICKSPERMINUTE;
116 }
117 }
118 }
119 else
120 {
121 *TimeZoneId = TIME_ZONE_ID_UNKNOWN;
122 }
123
124 return TRUE;
125}
126
127/*++
128 * @name ExAcquireTimeRefreshLock
129 *
130 * The ExReleaseTimeRefreshLock routine acquires the system-wide lock used
131 * to synchronize clock interrupt frequency changes.
132 *
133 * @param Wait
134 * If TRUE, the system will block the caller thread waiting for the lock
135 * to become available. If FALSE, the routine will fail if the lock has
136 * already been acquired.
137 *
138 * @return Boolean value indicating success or failure of the lock acquisition.
139 *
140 * @remarks None.
141 *
142 *--*/
144NTAPI
146{
147 /* Block APCs */
149
150 /* Attempt lock acquisition */
152 {
153 /* Lock was not acquired, enable APCs and fail */
155 return FALSE;
156 }
157
158 /* Lock has been acquired */
159 return TRUE;
160}
161
162/*++
163 * @name ExReleaseTimeRefreshLock
164 *
165 * The ExReleaseTimeRefreshLock routine releases the system-wide lock used
166 * to synchronize clock interrupt frequency changes.
167 *
168 * @param None.
169 *
170 * @return None.
171 *
172 * @remarks None.
173 *
174 *--*/
175VOID
176NTAPI
178{
179 /* Release the lock and re-enable APCs */
182}
183
184/*++
185 * @name ExSetTimerResolution
186 * @exported
187 *
188 * The KiInsertQueueApc routine modifies the frequency at which the system
189 * clock interrupts.
190 *
191 * @param DesiredTime
192 * Specifies the amount of time that should elapse between each timer
193 * interrupt, in 100-nanosecond units.
194 *
195 * This parameter is ignored if SetResolution is FALSE.
196 *
197 * @param SetResolution
198 * If TRUE, the call is a request to set the clock interrupt frequency to
199 * the value specified by DesiredTime. If FALSE, the call is a request to
200 * restore the clock interrupt frequency to the system's default value.
201 *
202 * @return New timer resolution, in 100-nanosecond ticks.
203 *
204 * @remarks (1) The clock frequency is changed only if the DesiredTime value is
205 * less than the current setting.
206 *
207 * (2) The routine just returns the current setting if the DesiredTime
208 * value is greater than what is currently set.
209 *
210 * (3) If the DesiredTime value is less than the system clock can
211 * support, the routine uses the smallest resolution the system can
212 * support, and returns that value.
213 *
214 * (4) If multiple drivers have attempted to change the clock interrupt
215 * frequency, the system will only restore the default frequency
216 * once ALL drivers have called the routine with SetResolution set
217 * to FALSE.
218 *
219 * NB. This routine synchronizes with IRP_MJ_POWER requests through the
220 * TimeRefreshLock.
221 *
222 *--*/
223ULONG
224NTAPI
227{
228 ULONG CurrentIncrement;
229
230 /* Wait for clock interrupt frequency and power requests to synchronize */
232
233 /* Obey remark 2*/
234 CurrentIncrement = KeTimeIncrement;
235
236 /* Check the type of operation this is */
237 if (SetResolution)
238 {
239 /*
240 * If this is the first kernel change, bump the timer resolution change
241 * count, then bump the kernel change count as well.
242 *
243 * These two variables are tracked differently since user-mode processes
244 * can also change the timer resolution through the NtSetTimerResolution
245 * system call. A per-process flag in the EPROCESS then stores the per-
246 * process change state.
247 *
248 */
250
251 /* Obey remark 3 */
252 if (DesiredTime < KeMinimumIncrement) DesiredTime = KeMinimumIncrement;
253
254 /* Obey remark 1 */
255 if (DesiredTime < KeTimeIncrement)
256 {
257 /* Force this thread on CPU zero, since we don't want it to drift */
259
260 /* Now call the platform driver (HAL) to make the change */
261 CurrentIncrement = HalSetTimeIncrement(DesiredTime);
262
263 /* Put the thread back to its original affinity */
265
266 /* Finally, keep track of the new value in the kernel */
267 KeTimeIncrement = CurrentIncrement;
268 }
269 }
270 else
271 {
272 /* First, make sure that a driver has actually changed the resolution */
274 {
275 /* Obey remark 4 */
277 {
278 /*
279 * All kernel drivers have requested the original frequency to
280 * be restored, but there might still be user processes with an
281 * ongoing clock interrupt frequency change, so make sure that
282 * this isn't the case.
283 */
285 {
286 /* Force this thread on one CPU so that it doesn't drift */
288
289 /* Call the HAL to restore the frequency to its default */
290 CurrentIncrement = HalSetTimeIncrement(KeMaximumIncrement);
291
292 /* Put the thread back to its original affinity */
294
295 /* Finally, keep track of the new value in the kernel */
296 KeTimeIncrement = CurrentIncrement;
297 }
298 }
299 }
300 }
301
302 /* Release the clock interrupt frequency lock since changes are done */
304
305 /* And return the current value -- which could reflect the new frequency */
306 return CurrentIncrement;
307}
308
309VOID
310NTAPI
312 IN ULONG MaxSepInSeconds)
313{
314 /* FIXME: TODO */
315 return;
316}
317
319NTAPI
321{
322 LARGE_INTEGER CurrentTime, NewTimeZoneBias;
324
325 DPRINT("ExRefreshTimeZoneInformation\n");
326
327 /* Set the global data for ExpTimeZoneBias and the Time Zone ID */
328 Success = ExpGetTimeZoneId(CurrentBootTime, &ExpTimeZoneId, &NewTimeZoneBias);
329 if (!Success)
330 {
331 DPRINT1("ExpGetTimeZoneId failed\n");
332 return FALSE;
333 }
334 DPRINT("ExpTimeZoneId is %lu\n", ExpTimeZoneId);
335
336 ExpTimeZoneBias = NewTimeZoneBias;
337
338 /* Change SharedUserData->TimeZoneBias for user-mode applications */
340 SharedUserData->TimeZoneId = ExpTimeZoneId;
341
342 /* Convert boot time from local time to UTC */
344
345 /* Convert system time from local time to UTC */
346 KeQuerySystemTime(&CurrentTime);;
347
348 /* Change it for user-mode applications */
349 CurrentTime.QuadPart += ExpTimeZoneBias.QuadPart;
350 KiWriteSystemTime(&SharedUserData->SystemTime, CurrentTime);
351
352 /* Return success */
353 return TRUE;
354}
355
358{
359 LARGE_INTEGER LocalTime, SystemTime, OldTime, NewTimeZoneBias;
363 LARGE_INTEGER LocalTimeNow;
364
365 DPRINT("ExpSetTimeZoneInformation called\n");
366
367 /* Read time zone information from the registry */
369 if (!NT_SUCCESS(Status))
370 {
371 DPRINT1("RtlQueryTimeZoneInformation failed (Status 0x%08lx)\n", Status);
372 return FALSE;
373 }
374
375 /* Get the default bias */
377
378 /* Get the Shared User Data System Time into the local SystemTime */
379 KeQuerySystemTime(&SystemTime);
380
381 LocalTimeNow = SystemTime;
382
383 /* Adjust LocalTimeNow for Time Zone Bias to use UTC for comparisons */
384 LocalTimeNow.QuadPart -= NewTimeZoneBias.QuadPart;
385
386 /* Set the Global Data for ExpTimeZoneBias and ExpTimeZoneId */
387 Success = ExpGetTimeZoneId(&LocalTimeNow, &ExpTimeZoneId, &NewTimeZoneBias);
388 if (!Success)
389 {
390 DPRINT1("ExpGetTimeZoneId failed\n");
391 return STATUS_UNSUCCESSFUL;
392 }
393 DPRINT("ExpTimeZoneId is %lu\n", ExpTimeZoneId);
394
395 ExpTimeZoneBias = NewTimeZoneBias;
396
397 DPRINT("Old time zone bias: %d minutes\n", ExpTimeZoneInfo.Bias);
398 DPRINT("Old time zone standard bias: %d minutes\n",
400 DPRINT("New time zone bias: %d minutes\n", TimeZoneInformation->Bias);
401 DPRINT("New time zone standard bias: %d minutes\n",
402 TimeZoneInformation->StandardBias);
403
404 /* Get the local time */
406 RtlTimeFieldsToTime(&TimeFields, &LocalTime);
407
408 /* Calculate the bias */
409 ExpTimeZoneBias.QuadPart = ((LONGLONG)(TimeZoneInformation->Bias +
410 TimeZoneInformation->StandardBias)) *
412
413 /* If Daylight Savings Time then add the DayLightBias to the Time Zone Bias */
416
417 /* Copy the timezone information */
419 TimeZoneInformation,
421
422 /* Set the new time zone information */
424 SharedUserData->TimeZoneId = ExpTimeZoneId;
425
426 DPRINT("New time zone bias: %I64d minutes\n",
428
429 /* Calculate the new system time */
430 ExLocalTimeToSystemTime(&LocalTime, &SystemTime);
431
432 /* Set the new system time and notify the system */
433 KeSetSystemTime(&SystemTime, &OldTime, FALSE, NULL);
435
436 /* Return success */
437 DPRINT("ExpSetTimeZoneInformation done\n");
438 return STATUS_SUCCESS;
439}
440
441/*
442 * FUNCTION: Sets the system time.
443 * PARAMETERS:
444 * NewTime - Points to a variable that specified the new time
445 * of day in the standard time format.
446 * OldTime - Optionally points to a variable that receives the
447 * old time of day in the standard time format.
448 * RETURNS: Status
449 */
451NTAPI
453 OUT PLARGE_INTEGER PreviousTime OPTIONAL)
454{
455 LARGE_INTEGER OldSystemTime;
456 LARGE_INTEGER NewSystemTime;
457 LARGE_INTEGER LocalTime;
461 RTL_TIME_ZONE_INFORMATION TimeZoneInformation = { 0 };
462 ULONG TimeZoneIdSave;
463
464 PAGED_CODE();
465
466 // TODO: Handle the case when SystemTime == NULL, which means:
467 // "update system time using the current time-zone information".
468 if (!SystemTime)
469 {
472 }
473
474 /* Check if we were called from user-mode */
476 {
478 {
479 /* Verify the time pointers */
480 NewSystemTime = ProbeForReadLargeInteger(SystemTime);
481 if (PreviousTime) ProbeForWriteLargeInteger(PreviousTime);
482 }
484 {
485 /* Return the exception code */
487 }
488 _SEH2_END;
489 }
490 else
491 {
492 /* Reuse the pointer */
493 NewSystemTime = *SystemTime;
494 }
495
496 /* Make sure we have permission to change the time */
498 {
499 DPRINT1("NtSetSystemTime: Caller requires the "
500 "SeSystemtimePrivilege privilege!\n");
502 }
503
504 /* Convert the time and set it in HAL */
505 ExSystemTimeToLocalTime(&NewSystemTime, &LocalTime);
506 RtlTimeToTimeFields(&LocalTime, &TimeFields);
508
509 /* Now set the system time and notify the system */
510 KeSetSystemTime(&NewSystemTime, &OldSystemTime, FALSE, NULL);
512
513 /* Check if caller wanted previous time */
514 if (PreviousTime)
515 {
516 /* Enter SEH Block for return */
518 {
519 /* Return the previous time */
520 *PreviousTime = OldSystemTime;
521 }
523 {
524 /* Get the exception code */
526 }
527 _SEH2_END;
528 }
529
530 /* Read time zone information from the registry and set the clock */
531 Status = RtlQueryTimeZoneInformation(&TimeZoneInformation);
532 if (!NT_SUCCESS(Status))
533 {
534 DPRINT1("RtlQueryTimeZoneInformation failed (Status 0x%08lx)\n", Status);
535 }
536
537 /* Test if we went from Daylight to Standard Time or vice versa */
538 TimeZoneIdSave = ExpTimeZoneId;
539 ExpSetTimeZoneInformation(&TimeZoneInformation);
540
541 if (ExpTimeZoneId != TimeZoneIdSave)
542 {
543 /* Going from DT to ST or vice versa we need to repeat this */
544 DPRINT("Daylight Time and Standard Time are switching\n");
545
546 /* Set the system time and notify the system */
547 KeSetSystemTime(&NewSystemTime, &OldSystemTime, FALSE, NULL);
549 }
550
551 /* Return status */
552 return Status;
553}
554
555/*
556 * FUNCTION: Retrieves the system time.
557 * PARAMETERS:
558 * CurrentTime - Points to a variable that receives the current
559 * time of day in the standard time format.
560 */
562NTAPI
564{
566 PAGED_CODE();
567
568 /* Check if we were called from user-mode */
570 {
572 {
573 /* Verify the time pointer */
574 ProbeForWriteLargeInteger(SystemTime);
575
576 /*
577 * It's safe to pass the pointer directly to KeQuerySystemTime
578 * as it's just a basic copy to this pointer. If it raises an
579 * exception nothing dangerous can happen!
580 */
581 KeQuerySystemTime(SystemTime);
582 }
584 {
585 /* Return the exception code */
587 }
588 _SEH2_END;
589 }
590 else
591 {
592 /* Query the time directly */
593 KeQuerySystemTime(SystemTime);
594 }
595
596 /* Return success */
597 return STATUS_SUCCESS;
598}
599
600/*
601 * @implemented
602 */
603VOID
604NTAPI
606 PLARGE_INTEGER SystemTime)
607{
608 SystemTime->QuadPart = LocalTime->QuadPart + ExpTimeZoneBias.QuadPart;
609}
610
611/*
612 * @implemented
613 */
614VOID
615NTAPI
617 PLARGE_INTEGER LocalTime)
618{
619 LocalTime->QuadPart = SystemTime->QuadPart - ExpTimeZoneBias.QuadPart;
620}
621
622/*
623 * @implemented
624 */
626NTAPI
628 OUT PULONG MaximumResolution,
629 OUT PULONG ActualResolution)
630{
632
633 /* Check if the call came from user-mode */
635 {
637 {
638 /* Probe the parameters */
639 ProbeForWriteUlong(MinimumResolution);
640 ProbeForWriteUlong(MaximumResolution);
641 ProbeForWriteUlong(ActualResolution);
642
643 /*
644 * Set the parameters to the actual values.
645 *
646 * NOTE:
647 * MinimumResolution corresponds to the biggest time increment and
648 * MaximumResolution corresponds to the smallest time increment.
649 */
650 *MinimumResolution = KeMaximumIncrement;
651 *MaximumResolution = KeMinimumIncrement;
652 *ActualResolution = KeTimeIncrement;
653 }
655 {
656 /* Return the exception code */
658 }
659 _SEH2_END;
660 }
661 else
662 {
663 /* Set the parameters to the actual values */
664 *MinimumResolution = KeMaximumIncrement;
665 *MaximumResolution = KeMinimumIncrement;
666 *ActualResolution = KeTimeIncrement;
667 }
668
669 /* Return success */
670 return STATUS_SUCCESS;
671}
672
673/*
674 * @implemented
675 */
677NTAPI
678NtSetTimerResolution(IN ULONG DesiredResolution,
680 OUT PULONG CurrentResolution)
681{
685 ULONG NewResolution;
686
687 /* Check if the call came from user-mode */
689 {
691 {
692 /* Probe the parameter */
693 ProbeForWriteUlong(CurrentResolution);
694 }
696 {
697 /* Return the exception code */
699 }
700 _SEH2_END;
701 }
702
703 /* Set and return the new resolution */
704 NewResolution = ExSetTimerResolution(DesiredResolution, SetResolution);
705
707 {
709 {
710 *CurrentResolution = NewResolution;
711 }
713 {
714 /* Return the exception code */
716 }
717 _SEH2_END;
718 }
719 else
720 {
721 *CurrentResolution = NewResolution;
722 }
723
724 if (SetResolution || Process->SetTimerResolution)
725 {
726 /* The resolution has been changed now or in an earlier call */
728 }
729 else
730 {
731 /* The resolution hasn't been changed */
733 }
734
735 /* Update the flag */
736 Process->SetTimerResolution = SetResolution;
737
738 return Status;
739}
740
741/* EOF */
#define PAGED_CODE()
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
_In_ PVOID _In_ ULONG _Out_ PVOID _In_ ULONG _Inout_ PULONG _In_ KPROCESSOR_MODE PreviousMode
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define ExLocalTimeToSystemTime(LocTime, SysTime)
Definition: env_spec_w32.h:738
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
ULONG ERESOURCE
Definition: env_spec_w32.h:594
#define ExSystemTimeToLocalTime(SysTime, LocTime)
Definition: env_spec_w32.h:729
@ Success
Definition: eventcreate.c:712
#define ExGetPreviousMode
Definition: ex.h:143
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
Status
Definition: gdiplustypes.h:25
ULONG NTAPI HalSetTimeIncrement(IN ULONG Increment)
Definition: timer.c:102
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:349
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
if(dx< 0)
Definition: linetemp.h:194
static PTIME_FIELDS TimeFields
Definition: time.c:36
#define KernelMode
Definition: asm.h:38
FORCEINLINE VOID KiWriteSystemTime(_Out_ volatile KSYSTEM_TIME *SystemTime, _In_ LARGE_INTEGER NewTime)
Definition: kefuncs.h:429
NTSYSAPI NTSTATUS NTAPI RtlQueryTimeZoneInformation(_Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
NTSYSAPI BOOLEAN NTAPI RtlCutoverTimeToSystemTime(_In_ PTIME_FIELDS CutoverTimeFields, _Out_ PLARGE_INTEGER SystemTime, _In_ PLARGE_INTEGER CurrentTime, _In_ BOOLEAN ThisYearsCutoverOnly)
#define TIME_ZONE_ID_UNKNOWN
Definition: rtltypes.h:252
#define TIME_ZONE_ID_STANDARD
Definition: rtltypes.h:253
#define TIME_ZONE_ID_DAYLIGHT
Definition: rtltypes.h:254
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
LARGE_INTEGER ExpTimeZoneBias
Definition: time.c:23
RTL_TIME_ZONE_INFORMATION ExpTimeZoneInfo
Definition: time.c:21
ULONG NTAPI ExSetTimerResolution(IN ULONG DesiredTime, IN BOOLEAN SetResolution)
Definition: time.c:225
NTSTATUS NTAPI NtQueryTimerResolution(OUT PULONG MinimumResolution, OUT PULONG MaximumResolution, OUT PULONG ActualResolution)
Definition: time.c:627
VOID NTAPI ExUpdateSystemTimeFromCmos(IN BOOLEAN UpdateInterruptTime, IN ULONG MaxSepInSeconds)
Definition: time.c:311
ERESOURCE ExpTimeRefreshLock
Definition: time.c:27
NTSTATUS NTAPI NtSetTimerResolution(IN ULONG DesiredResolution, IN BOOLEAN SetResolution, OUT PULONG CurrentResolution)
Definition: time.c:678
static BOOLEAN ExpGetTimeZoneId(_In_ PLARGE_INTEGER TimeNow, _Out_ PULONG TimeZoneId, _Out_ PLARGE_INTEGER NewTimeZoneBias)
Definition: time.c:39
ULONG ExpAltTimeZoneBias
Definition: time.c:24
#define TICKSPERMINUTE
Definition: time.c:16
ULONG ExpTickCountMultiplier
Definition: time.c:26
ULONG ExpLastTimeZoneBias
Definition: time.c:22
ULONG ExpTimeZoneId
Definition: time.c:25
ULONG ExpTimerResolutionCount
Definition: time.c:29
VOID NTAPI ExReleaseTimeRefreshLock(VOID)
Definition: time.c:177
ULONG ExpKernelResolutionCount
Definition: time.c:28
NTSTATUS ExpSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
Definition: time.c:357
BOOLEAN NTAPI ExAcquireTimeRefreshLock(IN BOOLEAN Wait)
Definition: time.c:145
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:563
NTSTATUS NTAPI NtSetSystemTime(IN PLARGE_INTEGER SystemTime, OUT PLARGE_INTEGER PreviousTime OPTIONAL)
Definition: time.c:452
BOOLEAN NTAPI ExRefreshTimeZoneInformation(IN PLARGE_INTEGER CurrentBootTime)
Definition: time.c:320
VOID NTAPI KeSetSystemTime(IN PLARGE_INTEGER NewSystemTime, OUT PLARGE_INTEGER OldSystemTime, IN BOOLEAN FixInterruptTime, IN PLARGE_INTEGER HalTime)
Definition: clock.c:28
ULONG KeTimeIncrement
Definition: clock.c:22
LARGE_INTEGER KeBootTime
Definition: clock.c:17
const LUID SeSystemtimePrivilege
Definition: priv.c:31
ULONG KeMinimumIncrement
Definition: clock.c:21
ULONG KeMaximumIncrement
Definition: clock.c:20
BOOLEAN NTAPI SeSinglePrivilegeCheck(_In_ LUID PrivilegeValue, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a single privilege is present in the context of the calling thread.
Definition: priv.c:744
#define STATUS_TIMER_RESOLUTION_NOT_SET
Definition: ntstatus.h:835
VOID NTAPI PoNotifySystemTimeSet(VOID)
Definition: events.c:39
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:207
BOOLEAN NTAPI HalQueryRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:24
BOOLEAN NTAPI HalSetRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:45
#define ProbeForWriteLargeInteger(Ptr)
Definition: probe.h:46
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
#define ProbeForReadLargeInteger(Ptr)
Definition: probe.h:75
#define SharedUserData
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
VOID NTAPI KeSetSystemAffinityThread(IN KAFFINITY Affinity)
Definition: thrdobj.c:1107
VOID NTAPI KeRevertToUserAffinityThread(VOID)
Definition: thrdobj.c:1021
uint32_t * PULONG
Definition: typedefs.h:59
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:1078
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define PsGetCurrentProcess
Definition: psfuncs.h:17