From 7319157d7dee0ec123aa0494cf78e06fe34b0a10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Fri, 10 Aug 2007 21:30:41 -0500 Subject: [PATCH] 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 ff1a28ad82..005a5c705c 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 aeadd48033..1d0261526c 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; -- 2.32.0.93.g670b81a890