https://bugs.winehq.org/show_bug.cgi?id=38272
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- I looked it up out of curiosity, and the reason seems to be that Go runtime doesn't use APIs to get timestamps, and instead uses fixed address access to read process memory, where supposedly kernel mirrors some time info as well other information:
--- src/runtime/os_windows.c --- #pragma dataflag NOPTR const KSYSTEM_TIME* INTERRUPT_TIME = (KSYSTEM_TIME*)0x7ffe0008; #pragma dataflag NOPTR const KSYSTEM_TIME* SYSTEM_TIME = (KSYSTEM_TIME*)0x7ffe0014;
static void badsystime(void);
#pragma textflag NOSPLIT int64 runtimeВ·systime(KSYSTEM_TIME *timeaddr) { KSYSTEM_TIME t; int32 i; void (*fn)(void);
for(i = 1; i < 10000; i++) { // these fields must be read in that order (see URL above) t.High1Time = timeaddr->High1Time; t.LowPart = timeaddr->LowPart; t.High2Time = timeaddr->High2Time; if(t.High1Time == t.High2Time) return (int64)t.High1Time<<32 | t.LowPart; if((i%100) == 0) runtimeВ·osyield(); } fn = badsystime; runtimeВ·onM(&fn); return 0; }
#pragma textflag NOSPLIT int64 runtimeВ·unixnano(void) { return (runtimeВ·systime(SYSTEM_TIME) - 116444736000000000LL) * 100LL; } ---