ReactOS  0.4.13-dev-249-gcba1a2f
time.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: dll/win32/kernel32/client/time.c
5  * PURPOSE: Time conversion functions
6  * PROGRAMMER: Ariadne
7  * DOSDATE and DOSTIME structures from Onno Hovers
8  * UPDATE HISTORY:
9  * Created 19/01/99
10  */
11 
12 /* INCLUDES *******************************************************************/
13 
14 #include <k32.h>
15 
16 #define NDEBUG
17 #include <debug.h>
18 
19 /* FUNCTIONS ******************************************************************/
20 
21 /*
22  * @implemented
23  */
24 BOOL
25 WINAPI
27 {
28  /* Return if a TS Timezone ID is active */
30 }
31 
32 /*
33  * @implemented
34  */
35 BOOL
36 WINAPI
38  OUT LPWORD lpFatDate,
39  OUT LPWORD lpFatTime)
40 {
41  LARGE_INTEGER FileTime;
43 
44  FileTime.HighPart = lpFileTime->dwHighDateTime;
45  FileTime.LowPart = lpFileTime->dwLowDateTime;
46 
47  if (FileTime.QuadPart < 0)
48  {
50  return FALSE;
51  }
52 
53  RtlTimeToTimeFields(&FileTime, &TimeFields);
54  if ((TimeFields.Year < 1980) || (TimeFields.Year > 2107))
55  {
57  return FALSE;
58  }
59 
60  *lpFatDate = (TimeFields.Day) |
61  (TimeFields.Month << 5) |
62  ((TimeFields.Year - 1980) << 9);
63  *lpFatTime = (TimeFields.Second >> 1) |
64  (TimeFields.Minute << 5) |
65  (TimeFields.Hour << 11);
66 
67  return TRUE;
68 }
69 
70 /*
71  * @implemented
72  */
73 BOOL
74 WINAPI
76  IN WORD wFatTime,
77  OUT LPFILETIME lpFileTime)
78 {
80  LARGE_INTEGER SystemTime;
81 
82  TimeFields.Year = (wFatDate >> 9) + 1980;
83  TimeFields.Month = (wFatDate >> 5) & 0xF;
84  TimeFields.Day = (wFatDate & 0x1F);
85  TimeFields.Hour = (wFatTime >> 11);
86  TimeFields.Minute = (wFatTime >> 5) & 0x3F;
87  TimeFields.Second = (wFatTime & 0x1F) << 1;
89 
90  if (RtlTimeFieldsToTime(&TimeFields, &SystemTime))
91  {
92  lpFileTime->dwLowDateTime = SystemTime.LowPart;
93  lpFileTime->dwHighDateTime = SystemTime.HighPart;
94  return TRUE;
95  }
96 
98  return FALSE;
99 }
100 
101 /*
102  * @implemented
103  */
104 LONG
105 WINAPI
107  IN CONST FILETIME *lpFileTime2)
108 {
109  LARGE_INTEGER Time1, Time2, Diff;
110 
111  Time1.LowPart = lpFileTime1->dwLowDateTime;
112  Time2.LowPart = lpFileTime2->dwLowDateTime;
113  Time1.HighPart = lpFileTime1->dwHighDateTime;
114  Time2.HighPart = lpFileTime2->dwHighDateTime;
115 
116  Diff.QuadPart = Time1.QuadPart - Time2.QuadPart;
117 
118  if (Diff.HighPart < 0) return -1;
119  if (Diff.QuadPart == 0) return 0;
120  return 1;
121 }
122 
123 /*
124  * @implemented
125  */
126 VOID
127 WINAPI
129 {
130  LARGE_INTEGER SystemTime;
131 
132  do
133  {
134  SystemTime.HighPart = SharedUserData->SystemTime.High1Time;
135  SystemTime.LowPart = SharedUserData->SystemTime.LowPart;
136  }
137  while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time);
138 
139  lpFileTime->dwLowDateTime = SystemTime.LowPart;
140  lpFileTime->dwHighDateTime = SystemTime.HighPart;
141 }
142 
143 /*
144  * @implemented
145  */
146 BOOL
147 WINAPI
149  OUT LPFILETIME lpFileTime)
150 {
152  LARGE_INTEGER liTime;
153 
154  TimeFields.Year = lpSystemTime->wYear;
155  TimeFields.Month = lpSystemTime->wMonth;
156  TimeFields.Day = lpSystemTime->wDay;
157  TimeFields.Hour = lpSystemTime->wHour;
158  TimeFields.Minute = lpSystemTime->wMinute;
159  TimeFields.Second = lpSystemTime->wSecond;
160  TimeFields.Milliseconds = lpSystemTime->wMilliseconds;
161 
162  if (RtlTimeFieldsToTime(&TimeFields, &liTime))
163  {
164  lpFileTime->dwLowDateTime = liTime.u.LowPart;
165  lpFileTime->dwHighDateTime = liTime.u.HighPart;
166  return TRUE;
167  }
168 
170  return FALSE;
171 }
172 
173 /*
174  * @implemented
175  */
176 BOOL
177 WINAPI
179  OUT LPSYSTEMTIME lpSystemTime)
180 {
182  LARGE_INTEGER liTime;
183 
184  liTime.u.LowPart = lpFileTime->dwLowDateTime;
185  liTime.u.HighPart = lpFileTime->dwHighDateTime;
186  if (liTime.QuadPart < 0)
187  {
189  return FALSE;
190  }
191 
192  RtlTimeToTimeFields(&liTime, &TimeFields);
193 
194  lpSystemTime->wYear = TimeFields.Year;
195  lpSystemTime->wMonth = TimeFields.Month;
196  lpSystemTime->wDay = TimeFields.Day;
197  lpSystemTime->wHour = TimeFields.Hour;
198  lpSystemTime->wMinute = TimeFields.Minute;
199  lpSystemTime->wSecond = TimeFields.Second;
200  lpSystemTime->wMilliseconds = TimeFields.Milliseconds;
201  lpSystemTime->wDayOfWeek = TimeFields.Weekday;
202 
203  return TRUE;
204 }
205 
206 /*
207  * @implemented
208  */
209 BOOL
210 WINAPI
212  OUT LPFILETIME lpLocalFileTime)
213 {
214  LARGE_INTEGER TimeZoneBias, FileTime;
215  volatile KSYSTEM_TIME *TimePtr;
216 
217  TimePtr = IsTimeZoneRedirectionEnabled() ?
219  &SharedUserData->TimeZoneBias;
220  do
221  {
222  TimeZoneBias.HighPart = TimePtr->High1Time;
223  TimeZoneBias.LowPart = TimePtr->LowPart;
224  }
225  while (TimeZoneBias.HighPart != TimePtr->High2Time);
226 
227  FileTime.LowPart = lpFileTime->dwLowDateTime;
228  FileTime.HighPart = lpFileTime->dwHighDateTime;
229 
230  FileTime.QuadPart -= TimeZoneBias.QuadPart;
231 
232  lpLocalFileTime->dwLowDateTime = FileTime.LowPart;
233  lpLocalFileTime->dwHighDateTime = FileTime.HighPart;
234 
235  return TRUE;
236 }
237 
238 /*
239  * @implemented
240  */
241 BOOL
242 WINAPI
244  OUT LPFILETIME lpFileTime)
245 {
246  LARGE_INTEGER TimeZoneBias, FileTime;
247  volatile KSYSTEM_TIME *TimePtr;
248 
249  TimePtr = IsTimeZoneRedirectionEnabled() ?
251  &SharedUserData->TimeZoneBias;
252 
253  do
254  {
255  TimeZoneBias.HighPart = TimePtr->High1Time;
256  TimeZoneBias.LowPart = TimePtr->LowPart;
257  }
258  while (TimeZoneBias.HighPart != TimePtr->High2Time);
259 
260  FileTime.LowPart = lpLocalFileTime->dwLowDateTime;
261  FileTime.HighPart = lpLocalFileTime->dwHighDateTime;
262 
263  FileTime.QuadPart += TimeZoneBias.QuadPart;
264 
265  lpFileTime->dwLowDateTime = FileTime.LowPart;
266  lpFileTime->dwHighDateTime = FileTime.HighPart;
267 
268  return TRUE;
269 }
270 
271 /*
272  * @implemented
273  */
274 VOID
275 WINAPI
277 {
278  LARGE_INTEGER SystemTime, TimeZoneBias;
280  volatile KSYSTEM_TIME *TimePtr;
281 
282  do
283  {
284  SystemTime.HighPart = SharedUserData->SystemTime.High1Time;
285  SystemTime.LowPart = SharedUserData->SystemTime.LowPart;
286  }
287  while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time);
288 
289  TimePtr = IsTimeZoneRedirectionEnabled() ?
291  &SharedUserData->TimeZoneBias;
292  do
293  {
294  TimeZoneBias.HighPart = TimePtr->High1Time;
295  TimeZoneBias.LowPart = TimePtr->LowPart;
296  }
297  while (TimeZoneBias.HighPart != TimePtr->High2Time);
298 
299  SystemTime.QuadPart -= TimeZoneBias.QuadPart;
300  RtlTimeToTimeFields(&SystemTime, &TimeFields);
301 
302  lpSystemTime->wYear = TimeFields.Year;
303  lpSystemTime->wMonth = TimeFields.Month;
304  lpSystemTime->wDay = TimeFields.Day;
305  lpSystemTime->wHour = TimeFields.Hour;
306  lpSystemTime->wMinute = TimeFields.Minute;
307  lpSystemTime->wSecond = TimeFields.Second;
308  lpSystemTime->wMilliseconds = TimeFields.Milliseconds;
309  lpSystemTime->wDayOfWeek = TimeFields.Weekday;
310 }
311 
312 /*
313  * @implemented
314  */
315 VOID
316 WINAPI
318 {
319  LARGE_INTEGER SystemTime;
321 
322  do
323  {
324  SystemTime.HighPart = SharedUserData->SystemTime.High1Time;
325  SystemTime.LowPart = SharedUserData->SystemTime.LowPart;
326  }
327  while (SystemTime.HighPart != SharedUserData->SystemTime.High2Time);
328 
329  RtlTimeToTimeFields(&SystemTime, &TimeFields);
330 
331  lpSystemTime->wYear = TimeFields.Year;
332  lpSystemTime->wMonth = TimeFields.Month;
333  lpSystemTime->wDay = TimeFields.Day;
334  lpSystemTime->wHour = TimeFields.Hour;
335  lpSystemTime->wMinute = TimeFields.Minute;
336  lpSystemTime->wSecond = TimeFields.Second;
337  lpSystemTime->wMilliseconds = TimeFields.Milliseconds;
338  lpSystemTime->wDayOfWeek = TimeFields.Weekday;
339 }
340 
341 /*
342  * @implemented
343  */
344 BOOL
345 WINAPI
347 {
348  LARGE_INTEGER NewSystemTime, TimeZoneBias;
352  PVOID State;
353  volatile KSYSTEM_TIME *TimePtr;
354 
355  TimePtr = IsTimeZoneRedirectionEnabled() ?
357  &SharedUserData->TimeZoneBias;
358  do
359  {
360  TimeZoneBias.HighPart = TimePtr->High1Time;
361  TimeZoneBias.LowPart = TimePtr->LowPart;
362  }
363  while (TimeZoneBias.HighPart != TimePtr->High2Time);
364 
365  TimeFields.Year = lpSystemTime->wYear;
366  TimeFields.Month = lpSystemTime->wMonth;
367  TimeFields.Day = lpSystemTime->wDay;
368  TimeFields.Hour = lpSystemTime->wHour;
369  TimeFields.Minute = lpSystemTime->wMinute;
370  TimeFields.Second = lpSystemTime->wSecond;
371  TimeFields.Milliseconds = lpSystemTime->wMilliseconds;
372 
373  if (!RtlTimeFieldsToTime(&TimeFields, &NewSystemTime))
374  {
376  return FALSE;
377  }
378 
379  NewSystemTime.QuadPart += TimeZoneBias.QuadPart;
380 
382  if (NT_SUCCESS(Status))
383  {
384  Status = NtSetSystemTime(&NewSystemTime, NULL);
386  }
387 
388  if (!NT_SUCCESS(Status))
389  {
391  return FALSE;
392  }
393 
394  return TRUE;
395 }
396 
397 /*
398  * @implemented
399  */
400 BOOL
401 WINAPI
403 {
404  LARGE_INTEGER NewSystemTime;
408  PVOID State;
409 
410  TimeFields.Year = lpSystemTime->wYear;
411  TimeFields.Month = lpSystemTime->wMonth;
412  TimeFields.Day = lpSystemTime->wDay;
413  TimeFields.Hour = lpSystemTime->wHour;
414  TimeFields.Minute = lpSystemTime->wMinute;
415  TimeFields.Second = lpSystemTime->wSecond;
416  TimeFields.Milliseconds = lpSystemTime->wMilliseconds;
417 
418  if (!RtlTimeFieldsToTime(&TimeFields, &NewSystemTime))
419  {
421  return FALSE;
422  }
423 
425  if (NT_SUCCESS(Status))
426  {
427  Status = NtSetSystemTime(&NewSystemTime, NULL);
429  }
430 
431  if (!NT_SUCCESS(Status))
432  {
434  return FALSE;
435  }
436 
437  return TRUE;
438 }
439 
440 /*
441  * @implemented
442  */
443 DWORD
444 WINAPI
446 {
447  ULARGE_INTEGER TickCount;
448 
449 #ifdef _WIN64
450  TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
451 #else
452  while (TRUE)
453  {
454  TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
455  TickCount.LowPart = SharedUserData->TickCount.LowPart;
456 
457  if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
458  break;
459 
460  YieldProcessor();
461  }
462 #endif
463 
464  return (ULONG)((UInt32x32To64(TickCount.LowPart,
465  SharedUserData->TickCountMultiplier) >> 24) +
466  UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
467  SharedUserData->TickCountMultiplier));
468 
469 }
470 
471 /*
472  * @implemented
473  */
474 BOOL
475 WINAPI
477  OUT PDWORD lpTimeIncrement,
478  OUT PBOOL lpTimeAdjustmentDisabled)
479 {
482 
484  &TimeInfo,
485  sizeof(TimeInfo),
486  NULL);
487  if (!NT_SUCCESS(Status))
488  {
490  return FALSE;
491  }
492 
493  *lpTimeAdjustment = (DWORD)TimeInfo.TimeAdjustment;
494  *lpTimeIncrement = (DWORD)TimeInfo.TimeIncrement;
495  *lpTimeAdjustmentDisabled = (BOOL)TimeInfo.Enable;
496 
497  return TRUE;
498 }
499 
500 /*
501  * @implemented
502  */
503 BOOL
504 WINAPI
506  IN BOOL bTimeAdjustmentDisabled)
507 {
510 
511  TimeInfo.TimeAdjustment = (ULONG)dwTimeAdjustment;
512  TimeInfo.Enable = (BOOLEAN)bTimeAdjustmentDisabled;
513 
515  &TimeInfo,
516  sizeof(TimeInfo));
517  if (!NT_SUCCESS(Status))
518  {
520  return FALSE;
521  }
522 
523  return TRUE;
524 }
525 
526 /*
527  * @implemented
528  */
529 BOOL
530 WINAPI
532  OUT LPFILETIME lpKernelTime OPTIONAL,
533  OUT LPFILETIME lpUserTime OPTIONAL)
534 {
536  LARGE_INTEGER TotalUserTime, TotalKernTime, TotalIdleTime;
538  CCHAR i;
540 
541  TotalUserTime.QuadPart = TotalKernTime.QuadPart = TotalIdleTime.QuadPart = 0;
542 
545 
546  ProcPerfInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize);
547  if (!ProcPerfInfo)
548  {
550  return FALSE;
551  }
552 
554  ProcPerfInfo,
555  BufferSize,
556  &ReturnLength);
557  if ((NT_SUCCESS(Status)) && (ReturnLength == BufferSize))
558  {
559  if (lpIdleTime)
560  {
562  {
563  TotalIdleTime.QuadPart += ProcPerfInfo[i].IdleTime.QuadPart;
564  }
565 
566  lpIdleTime->dwLowDateTime = TotalIdleTime.LowPart;
567  lpIdleTime->dwHighDateTime = TotalIdleTime.HighPart;
568  }
569 
570  if (lpKernelTime)
571  {
573  {
574  TotalKernTime.QuadPart += ProcPerfInfo[i].KernelTime.QuadPart;
575  }
576 
577  lpKernelTime->dwLowDateTime = TotalKernTime.LowPart;
578  lpKernelTime->dwHighDateTime = TotalKernTime.HighPart;
579  }
580 
581  if (lpUserTime)
582  {
584  {
585  TotalUserTime.QuadPart += ProcPerfInfo[i].UserTime.QuadPart;
586  }
587 
588  lpUserTime->dwLowDateTime = TotalUserTime.LowPart;
589  lpUserTime->dwHighDateTime = TotalUserTime.HighPart;
590  }
591  }
592  else if (NT_SUCCESS(Status))
593  {
595  }
596 
597  RtlFreeHeap(RtlGetProcessHeap(), 0, ProcPerfInfo);
598  if (!NT_SUCCESS(Status))
599  {
601  return FALSE;
602  }
603 
604  return TRUE;
605 }
606 
607 /*
608  * @unimplemented
609  */
610 BOOL
611 WINAPI
613 {
614  STUB;
615  return 0;
616 }
617 
618 /* EOF */
USHORT Weekday
Definition: env_spec_w32.h:718
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
ULONG LowPart
Definition: ketypes.h:910
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define IN
Definition: typedefs.h:38
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
BOOL WINAPI SetSystemTimeAdjustment(IN DWORD dwTimeAdjustment, IN BOOL bTimeAdjustmentDisabled)
Definition: time.c:505
VOID NTAPI RtlTimeToTimeFields(IN PLARGE_INTEGER Time, OUT PTIME_FIELDS TimeFields)
Definition: time.c:253
PBASE_STATIC_SERVER_DATA BaseStaticServerData
Definition: dllmain.c:19
static BOOL(WINAPI *pTzSpecificLocalTimeToSystemTime)(LPTIME_ZONE_INFORMATION
BOOL WINAPI SetSystemTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:402
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
BOOL WINAPI GetSystemTimeAdjustment(OUT PDWORD lpTimeAdjustment, OUT PDWORD lpTimeIncrement, OUT PBOOL lpTimeAdjustmentDisabled)
Definition: time.c:476
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
#define TIME_ZONE_ID_INVALID
Definition: winbase.h:283
#define SE_SYSTEMTIME_PRIVILEGE
Definition: security.c:666
$ULONG LowPart
Definition: ntbasedef.h:576
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:211
FORCEINLINE VOID YieldProcessor(VOID)
Definition: ke.h:32
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:451
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:243
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
NTSYSAPI VOID NTAPI RtlReleasePrivilege(_In_ PVOID ReturnedState)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
BOOL * PBOOL
Definition: windef.h:161
USHORT Milliseconds
Definition: env_spec_w32.h:717
NTSYSAPI NTSTATUS NTAPI NtSetSystemInformation(IN INT SystemInformationClass, IN PVOID SystemInformation, IN ULONG SystemInformationLength)
SYSTEM_BASIC_INFORMATION SysInfo
Definition: base.h:122
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
NTSTATUS NTAPI NtSetSystemTime(IN PLARGE_INTEGER SystemTime, OUT PLARGE_INTEGER PreviousTime OPTIONAL)
Definition: time.c:339
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:317
$ULONG HighPart
Definition: ntbasedef.h:577
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
LONG WINAPI CompareFileTime(IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2)
Definition: time.c:106
LONG High1Time
Definition: ketypes.h:911
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
char CCHAR
Definition: typedefs.h:50
#define WINAPI
Definition: msvc.h:8
#define BufferSize
Definition: classpnp.h:419
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
static DWORD(WINAPI *pGetDynamicTimeZoneInformation)(DYNAMIC_TIME_ZONE_INFORMATION *)
BOOL WINAPI SetClientTimeZoneInformation(IN CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: time.c:612
BOOL WINAPI GetSystemTimes(OUT LPFILETIME lpIdleTime OPTIONAL, OUT LPFILETIME lpKernelTime OPTIONAL, OUT LPFILETIME lpUserTime OPTIONAL)
Definition: time.c:531
unsigned __int64 ULONG64
Definition: imports.h:198
#define SharedUserData
ULONG LowPart
Definition: typedefs.h:104
Status
Definition: gdiplustypes.h:24
uint16_t * LPWORD
Definition: typedefs.h:54
LONG High2Time
Definition: ketypes.h:912
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
Definition: time.c:37
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
Definition: time.c:148
enum State_ State
Definition: pofuncs.h:54
KSYSTEM_TIME ktTermsrvClientBias
Definition: base.h:131
#define STUB
Definition: kernel32.h:27
static ULONG(WINAPI *pNtGetTickCount)(void)
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
BOOLEAN NTAPI RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, OUT PLARGE_INTEGER Time)
Definition: time.c:170
DWORD * PDWORD
Definition: pedump.c:68
NTSYSAPI NTSTATUS NTAPI RtlAcquirePrivilege(_In_ PULONG Privilege, _In_ ULONG NumPriv, _In_ ULONG Flags, _Out_ PVOID *ReturnedState)
struct _LARGE_INTEGER::@2192 u
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
static PTIME_FIELDS TimeFields
Definition: time.c:104
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:346
BOOL WINAPI IsTimeZoneRedirectionEnabled(VOID)
Definition: time.c:26
#define UInt32x32To64(a, b)
Definition: intsafe.h:258
ULONG TermsrvClientTimeZoneId
Definition: base.h:132
#define CONST
Definition: pedump.c:81
LONGLONG QuadPart
Definition: typedefs.h:112
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68