Remove NSPR's dependency on winmm.dll

RESOLVED FIXED in 4.0.2

Status

NSPR
NSPR
P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

4.0.2
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

18 years ago
NSPR uses only one function in winmm.dll: timeGetTime().
If we can replace timeGetTime() by an equivalent function,
we will be able to remove the dependency on winmm.dll.

A good candidate is GetTickCount().  It is documented
(http://msdn.microsoft.com/library/psdk/sysmgmt/time_8wz8.htm)
that a multimedia timer (timeGetTime()) or a high-resolution
timer (QueryPerformanceCounter()) has a higher resolution than
GetTickCount().  Because we always try QueryPerformanceCounter()
first, if all the hardware that we need to support has a
high-resolution performance counter, we should never need to
call GetTickCount().  Then, the lower resolution of GetTickCount()
will have negligible effect.
(Assignee)

Comment 1

18 years ago
Created attachment 10201 [details] [diff] [review]
Proposed patch.  Replace timeGetTime() with GetTickCount().
(Assignee)

Updated

18 years ago
Blocks: 29249
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → 4.1
(Assignee)

Comment 2

18 years ago
I did a test on our Win95 OSR2 and Win98 SE systems,
both with Pentium CPUs, and found that QueryPerformanceFrequency()
and QueryPerformanceCounter() are supported.  So the
high-resolution performance counter should be supported
on practically all the Windows systems that are in use
today.

I checked in the patch (id=10201) on the main trunk.
/cvsroot/mozilla/nsprpub/pr/src/Makefile, revision 3.34
/cvsroot/mozilla/nsprpub/pr/src/Makefile.in, revision 1.13
/cvsroot/mozilla/nsprpub/pr/src/md/windows/ntinrval.c, revision 3.8

Note that Mozilla is pulling the NSPRPUB_CLIENT_BRANCH of
NSPR so it is not picking up this change right now.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

18 years ago
I checked in the fix on both NSPRPUB_CLIENT_BRANCH
and NSPRPUB_RELEASE_4_0_BRANCH.  See bug #52725.

Set Target Milestone to 4.0.2.
Target Milestone: 4.1 → 4.0.2
You need to log in before you can comment on or make changes to this bug.