ntdll: Implement RtlGetSystemTimePrecise().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2019-05-14 09:53:42 +01:00 committed by Alexandre Julliard
parent 5ddcfa019d
commit aa4570fedd
3 changed files with 35 additions and 0 deletions

View File

@ -680,6 +680,7 @@
@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr)
# @ stub RtlGetSecurityDescriptorRMControl # @ stub RtlGetSecurityDescriptorRMControl
# @ stub RtlGetSetBootStatusData # @ stub RtlGetSetBootStatusData
@ stdcall -ret64 RtlGetSystemTimePrecise()
@ stdcall RtlGetThreadErrorMode() @ stdcall RtlGetThreadErrorMode()
@ stdcall RtlGetUnloadEventTrace() @ stdcall RtlGetUnloadEventTrace()
@ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr) @ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr)

View File

@ -474,6 +474,39 @@ NTSTATUS WINAPI NtQuerySystemTime( PLARGE_INTEGER Time )
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
/***********************************************************************
* RtlGetSystemTimePrecise [NTDLL.@]
*
* Get a more accurate current system time.
*
* RETURNS
* The current system time.
*/
LONGLONG WINAPI RtlGetSystemTimePrecise( void )
{
LONGLONG time;
#ifdef HAVE_CLOCK_GETTIME
struct timespec ts;
if (!clock_gettime( CLOCK_REALTIME, &ts ))
{
time = ts.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970;
time += (ts.tv_nsec + 50) / 100;
}
else
#endif
{
struct timeval now;
gettimeofday( &now, 0 );
time = now.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970;
time += now.tv_usec * 10;
}
return time;
}
/****************************************************************************** /******************************************************************************
* NtQueryPerformanceCounter [NTDLL.@] * NtQueryPerformanceCounter [NTDLL.@]
*/ */

View File

@ -2710,6 +2710,7 @@ NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSI
NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*); NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void); NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void);
NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*); NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*); NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID); NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);