--- wine/dlls/ntdll/nt.c 2005-02-12 08:18:02.000000000 +0100 +++ mywine/dlls/ntdll/nt.c 2005-02-21 19:28:46.000000000 +0100 @@ -519,10 +519,14 @@ NTSTATUS WINAPI NtQueryPerformanceCounte OUT PLARGE_INTEGER Counter, OUT PLARGE_INTEGER Frequency) { - LARGE_INTEGER time; - NtQuerySystemTime( &time ); - Counter->QuadPart = time.QuadPart; - Frequency->QuadPart = 10000000; + struct timeval now; + gettimeofday( &now, 0 ); + /* convert a counter that increments at a rate of 1 MHz + * to one of 1193182 Hz, with some care for arithmetic overflows + * ( will not overflow until 2038 ) */ + Counter->QuadPart = (((now.tv_sec - 1109009802)* (ULONGLONG) 1000000 + now.tv_usec ) + * 105) / 88 ; /* 105/88 = 1.19318182 */ + Frequency->QuadPart = 1193182; return 0; }