HyperDbg Debugger
Loading...
Searching...
No Matches
PlatformTime.c File Reference

Implementation of cross platform APIs for system time operations. More...

#include "pch.h"

Functions

VOID PlatformTimeQuerySystemTime (PLARGE_INTEGER SystemTime)
 Query the current system time.
VOID PlatformTimeConvertToLocalTime (PLARGE_INTEGER SystemTime, PLARGE_INTEGER LocalTime)
 Convert system time (UTC) to local time.
VOID PlatformTimeConvertToTimeFields (PLARGE_INTEGER Time, PTIME_FIELDS TimeFields)
 Convert a LARGE_INTEGER time value to a TIME_FIELDS structure.

Detailed Description

Implementation of cross platform APIs for system time operations.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.19
Date
2026-05-09

Function Documentation

◆ PlatformTimeConvertToLocalTime()

VOID PlatformTimeConvertToLocalTime ( PLARGE_INTEGER SystemTime,
PLARGE_INTEGER LocalTime )

Convert system time (UTC) to local time.

Parameters
SystemTimePointer to the system time value in UTC
LocalTimeReceives the converted local time value
Returns
VOID
51{
52#if defined(_WIN32) || defined(_WIN64)
53
54 ExSystemTimeToLocalTime(SystemTime, LocalTime);
55
56#elif defined(__linux__)
57
58# error "Not yet implemented"
59
60#else
61
62# error "Unsupported platform"
63
64#endif
65}

◆ PlatformTimeConvertToTimeFields()

VOID PlatformTimeConvertToTimeFields ( PLARGE_INTEGER Time,
PTIME_FIELDS TimeFields )

Convert a LARGE_INTEGER time value to a TIME_FIELDS structure.

Parameters
TimePointer to the time value to convert
TimeFieldsReceives the broken-down time fields (year, month, day, hour, minute, etc.)
Returns
VOID
76{
77#if defined(_WIN32) || defined(_WIN64)
78
79 RtlTimeToTimeFields(Time, TimeFields);
80
81#elif defined(__linux__)
82
83# error "Not yet implemented"
84
85#else
86
87# error "Unsupported platform"
88
89#endif
90}

◆ PlatformTimeQuerySystemTime()

VOID PlatformTimeQuerySystemTime ( PLARGE_INTEGER SystemTime)

Query the current system time.

Parameters
SystemTimeReceives the current system time as a LARGE_INTEGER (100-nanosecond units since January 1, 1601)
Returns
VOID
26{
27#if defined(_WIN32) || defined(_WIN64)
28
29 KeQuerySystemTime(SystemTime);
30
31#elif defined(__linux__)
32
33# error "Not yet implemented"
34
35#else
36
37# error "Unsupported platform"
38
39#endif
40}