Files
nt-lite/code/public/ntlite/time.h
T

39 lines
1.3 KiB
C

// Public NTLite time ABI declarations shared between kernel, drivers, and user mode.
#pragma once
#include <stddef.h>
#include <stdint.h>
#define SYS_TIME_FLAG_VALID 0x0001u
#define SYS_TIME_FLAG_TZ_KNOWN 0x0002u
#define SYS_TIME_FLAG_UEFI 0x0004u
#define SYS_TIME_FLAG_FALLBACK 0x0008u
#define SYS_TIME_FLAG_RTC 0x0010u
#define SYS_TIME_FLAG_DAYLIGHT 0x0020u
#define SYS_TIME_UNSPECIFIED_TZ 2047
// Calendar wall-clock time maintained by the kernel. DayOfWeek uses the
// Win32 convention: 0 = Sunday, 1 = Monday, ... 6 = Saturday.
// TimeZoneMinutes is minutes east of UTC for the returned local calendar.
// EpochSeconds is UTC seconds since 1970-01-01 00:00:00.
typedef struct SYS_SYSTEM_TIME {
uint16_t Year;
uint8_t Month;
uint8_t Day;
uint8_t Hour;
uint8_t Minute;
uint8_t Second;
uint8_t DayOfWeek;
uint16_t Millisecond;
uint16_t Flags;
uint32_t Nanosecond;
int16_t TimeZoneMinutes;
uint16_t Reserved0;
uint64_t EpochSeconds;
uint64_t TickMicroseconds;
} SYS_SYSTEM_TIME;
// File metadata and time syscalls share this fixed wall-clock representation.
_Static_assert(offsetof(SYS_SYSTEM_TIME, EpochSeconds) == 24u, "SYS_SYSTEM_TIME EpochSeconds offset changed");
_Static_assert(sizeof(SYS_SYSTEM_TIME) == 40u, "SYS_SYSTEM_TIME ABI size changed");