NtQuerySystemTime function

[NtQuerySystemTime may be altered or unavailable in future versions of Windows. Applications should use the GetSystemTimeAsFileTime function.]

Retrieves the current system time.

Syntax

__kernel_entry NTSTATUS NtQuerySystemTime(
  OUT PLARGE_INTEGER SystemTime
);

Parameters

SystemTime

A pointer to a LARGE_INTEGER structure that receives the system time. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

Return Value

If the function succeeds, it returns STATUS_SUCCESS. If it fails, it will return the appropriate status code, which will typically be STATUS_ACCESS_VIOLATION.

Remarks

This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.

Requirements

   
Target Platform Windows
Header winternl.h
DLL Ntdll.dll

See Also

GetSystemTimeAsFileTime

Time Functions