// Win32 multimedia timing entry points. #include #include typedef unsigned int MMRESULT; #define MMSYSERR_NOERROR 0u // Returns monotonic milliseconds since boot. __declspec(dllexport) unsigned long timeGetTime(void) { uint64_t frequency = 0; if (SysGetTickFrequency(&frequency) != NTLSTATUS_SUCCESS || !frequency) return 0; return (unsigned long)SysTicksToMilliseconds(SysGetTick(), frequency); } // Accepts timer-resolution requests without reprogramming the native timer. __declspec(dllexport) MMRESULT timeBeginPeriod(unsigned int periodMilliseconds) { (void)periodMilliseconds; return MMSYSERR_NOERROR; } // Releases one timer-resolution request without changing native timer policy. __declspec(dllexport) MMRESULT timeEndPeriod(unsigned int periodMilliseconds) { (void)periodMilliseconds; return MMSYSERR_NOERROR; }