BOOL WINAPI hook_QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
{
static LONGLONG oldfakevalue = 0;
static LONGLONG oldrealvalue = 0;
LONGLONG newvalue;
BOOL ret;
double factor = 1.0;
ret = QueryPerformanceCounter(lpPerformanceCount);
if(oldfakevalue == 0 || oldrealvalue == 0)
{
oldfakevalue = lpPerformanceCount->QuadPart;
oldrealvalue = lpPerformanceCount->QuadPart;
}
newvalue = lpPerformanceCount->QuadPart;
newvalue = oldfakevalue + (LONGLONG)((newvalue - oldrealvalue) * factor);
oldrealvalue = lpPerformanceCount->QuadPart;
oldfakevalue = newvalue;
lpPerformanceCount->QuadPart = newvalue;
return ret;
}