Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
288ebd32
Commit
288ebd32
authored
Feb 23, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Feb 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NtQueryPerformanceCounter should return a frequency of 1193182Hz and
counts like in Windows. Some applications depend on that. Simplify QueryPerformanceCounter a bit.
parent
494a34bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
cpu.c
dlls/kernel/cpu.c
+1
-2
nt.c
dlls/ntdll/nt.c
+15
-5
No files found.
dlls/kernel/cpu.c
View file @
288ebd32
...
...
@@ -192,8 +192,7 @@ static void create_registry_keys( const SYSTEM_INFO *info )
*/
BOOL
WINAPI
QueryPerformanceCounter
(
PLARGE_INTEGER
counter
)
{
LARGE_INTEGER
frequency
;
NtQueryPerformanceCounter
(
counter
,
&
frequency
);
NtQueryPerformanceCounter
(
counter
,
NULL
);
return
TRUE
;
}
...
...
dlls/ntdll/nt.c
View file @
288ebd32
...
...
@@ -37,6 +37,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ntdll
);
/* FIXME: fixed at 2005/2/22 */
static
LONGLONG
boottime
=
(
LONGLONG
)
1275356510
*
100000000
;
/* Structures used by NtConnectPort */
typedef
struct
LpcSectionInfo
...
...
@@ -512,8 +515,10 @@ NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
/******************************************************************************
* NtQueryPerformanceCounter [NTDLL.@]
*
* Note: Windows uses a timer clocked at a multiple of 1193182 Hz.
*
* Note: Windows uses a timer clocked at a multiple of 1193182 Hz. There is a
* good number of applications that crash when the returned frequency is either
* lower or higher then what Windows gives. Also too high counter values are
* reported to give problems.
*/
NTSTATUS
WINAPI
NtQueryPerformanceCounter
(
OUT
PLARGE_INTEGER
Counter
,
...
...
@@ -523,9 +528,14 @@ NTSTATUS WINAPI NtQueryPerformanceCounter(
if
(
!
Counter
)
return
STATUS_ACCESS_VIOLATION
;
NtQuerySystemTime
(
&
time
);
Counter
->
QuadPart
=
time
.
QuadPart
;
time
.
QuadPart
-=
boottime
;
/* convert a counter that increments at a rate of 10 MHz
* to one of 1193182 Hz, with some care for arithmetic
* overflow ( will not overflow until 3396 or so ) and
* good accuracy ( 21/176 = 0.119318182) */
Counter
->
QuadPart
=
(
time
.
QuadPart
*
21
)
/
176
;
if
(
Frequency
)
Frequency
->
QuadPart
=
1
0000000
;
Frequency
->
QuadPart
=
1
193182
;
return
0
;
}
...
...
@@ -625,7 +635,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
SYSTEM_TIMEOFDAY_INFORMATION
*
sti
=
(
SYSTEM_TIMEOFDAY_INFORMATION
*
)
SystemInformation
;
if
(
Length
>=
sizeof
(
*
sti
))
{
sti
->
liKeBootTime
.
QuadPart
=
0
;
/* FIXME */
sti
->
liKeBootTime
.
QuadPart
=
boottime
;
sti
->
liKeSystemTime
.
QuadPart
=
0
;
/* FIXME */
sti
->
liExpTimeZoneBias
.
QuadPart
=
0
;
/* FIXME */
sti
->
uCurrentTimeZoneId
=
0
;
/* FIXME */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment