http://bugs.winehq.org/show_bug.cgi?id=19963
Summary: GetSystemTimeAdjustment() should return 10000000 / sysconf(_SC_CLK_TCK) Product: Wine Version: 1.1.29 Platform: PC URL: http://rh-software.com/ OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: ray@pobox.co.uk CC: ray@pobox.co.uk
Currently there is now way to get the clock tick rate. GetSystemTimeAdjustment() should return this. The fix is trivial and shown below. Just because TimeAdjustmentDisabled is TRUE failing to return the current asjustment I beleive to be an error.
Change to code to be:
BOOL WINAPI GetSystemTimeAdjustment( PDWORD lpTimeAdjustment, PDWORD lpTimeIncrement, PBOOL lpTimeAdjustmentDisabled ) { *lpTimeAdjustment = 0; *lpTimeIncrement = 10000000 / sysconf(_SC_CLK_TCK); *lpTimeAdjustmentDisabled = TRUE; return TRUE; }
http://bugs.winehq.org/show_bug.cgi?id=19963
--- Comment #1 from Austin English austinenglish@gmail.com 2009-09-06 18:15:37 --- Please send patches to wine-patches@winehq.org.
http://bugs.winehq.org/show_bug.cgi?id=19963
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Alias|red-ray |
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-06 19:36:45 --- Except you assuming that kernel by default has 10000000 ticks per second. Which is not true on all systems.
http://bugs.winehq.org/show_bug.cgi?id=19963
--- Comment #3 from red-ray ray@pobox.co.uk 2009-09-07 08:39:38 --- (In reply to comment #2)
Except you assuming that kernel by default has 10000000 ticks per second. Which is not true on all systems.
No, if you look at http://msdn.microsoft.com/en-us/library/ms724394(VS.85).aspx you will see it says:
lpTimeIncrement [out] A pointer to a variable that the function sets to the interval between periodic time adjustments, in 100-nanosecond units. This interval is the time period between a system's clock interrupts. The 10000000 is nothing to do with the system ticks per second which is in fact returned by the sysconf(_SC_CLK_TCK)
Further Wine already uses the 10000000 constant when returning thread CPU times. The code is at WINE-1.1.29\dlls\ntdll\thread.c around line 1013 you will find.
long clocks_per_sec = sysconf(_SC_CLK_TCK);
times(&time_buf); kusrt.KernelTime.QuadPart = (ULONGLONG)time_buf.tms_stime * 10000000 / clocks_per_sec; kusrt.UserTime.QuadPart = (ULONGLONG)time_buf.tms_utime * 10000000 / clocks_per_sec;
http://bugs.winehq.org/show_bug.cgi?id=19963
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #4 from Austin English austinenglish@gmail.com 2009-09-07 17:39:51 --- Ray sent me a copy of the software. Confirming.
http://bugs.winehq.org/show_bug.cgi?id=19963
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2009-09-30 15:12:52 --- I didn't see a patch from Ray, so I went ahead and sent one: http://www.winehq.org/pipermail/wine-patches/2009-September/079207.html
http://bugs.winehq.org/show_bug.cgi?id=19963
--- Comment #6 from ray@pobox.co.uk 2009-09-30 17:26:34 --- (In reply to comment #5)
I didn't see a patch from Ray, so I went ahead and sent one: http://www.winehq.org/pipermail/wine-patches/2009-September/079207.html
Thank you. I don't know how to generate patches !
http://bugs.winehq.org/show_bug.cgi?id=19963
--- Comment #7 from Austin English austinenglish@gmail.com 2009-09-30 17:30:59 --- (In reply to comment #6)
(In reply to comment #5)
I didn't see a patch from Ray, so I went ahead and sent one: http://www.winehq.org/pipermail/wine-patches/2009-September/079207.html
Thank you. I don't know how to generate patches !
http://wiki.winehq.org/SubmittingPatches
http://bugs.winehq.org/show_bug.cgi?id=19963
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #8 from Dan Kegel dank@kegel.com 2009-09-30 20:33:31 --- Juan sent a patch: http://www.winehq.org/pipermail/wine-patches/2009-September/079207.html
http://bugs.winehq.org/show_bug.cgi?id=19963
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #9 from Juan Lang juan_lang@yahoo.com 2009-10-01 11:49:55 --- Fixed by commit 6614323807778b5ffede2498b1bee841a7eb4fa5, http://www.winehq.org/pipermail/wine-cvs/2009-October/059954.html
http://bugs.winehq.org/show_bug.cgi?id=19963
ray@pobox.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from ray@pobox.co.uk 2009-10-01 14:33:52 --- Yes, it's fixed. Thankyou.
http://bugs.winehq.org/show_bug.cgi?id=19963
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #11 from Nikolay Sivov bunglehead@gmail.com 2009-10-01 14:35:07 --- Will be closed with next release.
http://bugs.winehq.org/show_bug.cgi?id=19963
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org 2009-10-09 11:14:22 --- Closing bugs fixed in 1.1.31.