Alex Villacís Lasso : quartz: Fix IReferenceClock:: GetTime() implementation for system clock.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 13 06:31:51 CDT 2007
Module: wine
Branch: master
Commit: 7319157d7dee0ec123aa0494cf78e06fe34b0a10
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7319157d7dee0ec123aa0494cf78e06fe34b0a10
Author: Alex Villacís Lasso <a_villacis at palosanto.com>
Date: Fri Aug 10 21:30:41 2007 -0500
quartz: Fix IReferenceClock::GetTime() implementation for system clock.
---
dlls/quartz/systemclock.c | 7 ++-----
dlls/quartz/tests/referenceclock.c | 2 --
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
index ff1a28a..005a5c7 100644
--- a/dlls/quartz/systemclock.c
+++ b/dlls/quartz/systemclock.c
@@ -244,14 +244,11 @@ static HRESULT WINAPI SystemClockImpl_GetTime(IReferenceClock* iface, REFERENCE_
curTimeTickCount = GetTickCount();
EnterCriticalSection(&This->safe);
- /** TODO: safe this not using * 10000 */
+ if (This->lastTimeTickCount == curTimeTickCount) hr = S_FALSE;
This->lastRefTime += (REFERENCE_TIME) (DWORD) (curTimeTickCount - This->lastTimeTickCount) * (REFERENCE_TIME) 10000;
This->lastTimeTickCount = curTimeTickCount;
- LeaveCriticalSection(&This->safe);
-
*pTime = This->lastRefTime;
- if (This->lastTimeTickCount == curTimeTickCount) hr = S_FALSE;
- This->lastTimeTickCount = curTimeTickCount;
+ LeaveCriticalSection(&This->safe);
return hr;
}
diff --git a/dlls/quartz/tests/referenceclock.c b/dlls/quartz/tests/referenceclock.c
index aeadd48..1d02615 100644
--- a/dlls/quartz/tests/referenceclock.c
+++ b/dlls/quartz/tests/referenceclock.c
@@ -63,9 +63,7 @@ static void test_IReferenceClock_methods(const char * clockdesc, IReferenceClock
Sleep(1000); /* Sleep for at least 1 second */
hr = IReferenceClock_GetTime(pClock, &time2);
/* After a 1-second sleep, there is no excuse to get S_FALSE (see TODO above) */
- todo_wine {
ok (hr == S_OK, "%s - Expected S_OK, got 0x%08x\n", clockdesc, hr);
- }
/* FIXME: How much deviation should be allowed after a sleep? */
diff = time2 - time1;
More information about the wine-cvs
mailing list