mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- Uptime now shows over 49.7 days correctly in Vista or later.
- Some related tweaks.
This commit is contained in:
@ -951,6 +951,32 @@ OSPLATFORM CSystem::GetOSPlatform()
|
||||
return c_Platform;
|
||||
}
|
||||
|
||||
/*
|
||||
** GetTickCount64
|
||||
**
|
||||
** Retrieves the number of milliseconds that have elapsed since the system was started.
|
||||
** In XP, returns the predictive value due to the 32bit limitation.
|
||||
**
|
||||
*/
|
||||
ULONGLONG CSystem::GetTickCount64()
|
||||
{
|
||||
typedef ULONGLONG (WINAPI * FPGETTICKCOUNT64)();
|
||||
static FPGETTICKCOUNT64 c_GetTickCount64 = (FPGETTICKCOUNT64)GetProcAddress(GetModuleHandle(L"kernel32"), "GetTickCount64");
|
||||
|
||||
if (c_GetTickCount64)
|
||||
{
|
||||
return c_GetTickCount64();
|
||||
}
|
||||
else
|
||||
{
|
||||
static ULONGLONG lastTicks = 0;
|
||||
ULONGLONG ticks = GetTickCount();
|
||||
while (ticks < lastTicks) ticks += 0x100000000;
|
||||
lastTicks = ticks;
|
||||
return ticks;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** RmLoadLibrary
|
||||
**
|
||||
|
Reference in New Issue
Block a user