I don't know if I'm the best person to review this series, but I have no objections to it.
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Tue, Aug 25, 2020 at 10:54:00AM +0300, Arkadiusz Hiler wrote:
... and use it instead GetTickCount() within winmm.
Signed-off-by: Arkadiusz Hiler ahiler@codeweavers.com
dlls/winmm/tests/joystick.c | 4 ++-- dlls/winmm/tests/midi.c | 2 +- dlls/winmm/time.c | 18 ++++++++++++------ dlls/winmm/winmm.c | 12 ++++++------ dlls/winmm/winmm.spec | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/dlls/winmm/tests/joystick.c b/dlls/winmm/tests/joystick.c index 7531bd6481f..313e9684e96 100644 --- a/dlls/winmm/tests/joystick.c +++ b/dlls/winmm/tests/joystick.c @@ -202,12 +202,12 @@ static void test_api(void) if (winetest_interactive) { #define MAX_TIME 15000
DWORD tick = GetTickCount(), spent;
DWORD tick = timeGetTime(), spent; infoex.ex.dwSize = sizeof(infoex.ex); infoex.ex.dwFlags = JOY_RETURNALL; do {
spent = GetTickCount() - tick;
spent = timeGetTime() - tick; ret = joyGetPosEx(joyid, &infoex.ex); if (ret == JOYERR_NOERROR) {
diff --git a/dlls/winmm/tests/midi.c b/dlls/winmm/tests/midi.c index 2b1e91fe98a..a78f9b5ac71 100644 --- a/dlls/winmm/tests/midi.c +++ b/dlls/winmm/tests/midi.c @@ -555,7 +555,7 @@ static void CALLBACK time_stamp_callback(HMIDIOUT hmo, UINT msg, DWORD_PTR insta switch (msg) { case MM_MOM_POSITIONCB: if (records->count < ARRAY_SIZE(records->time_stamp))
records->time_stamp[records->count] = GetTickCount();
case MM_MOM_DONE:records->time_stamp[records->count] = timeGetTime(); records->count++; break;
diff --git a/dlls/winmm/time.c b/dlls/winmm/time.c index 22c89852a2f..de2a3fbc61e 100644 --- a/dlls/winmm/time.c +++ b/dlls/winmm/time.c @@ -131,7 +131,7 @@ static int TIME_MMSysTimeCallback(void) }
timer = LIST_ENTRY( ptr, WINE_TIMERENTRY, entry );
delta_time = timer->dwTriggerTime - GetTickCount();
delta_time = timer->dwTriggerTime - timeGetTime(); if (delta_time > 0) break; list_remove( &timer->entry );
@@ -242,16 +242,22 @@ void TIME_MMTimeStop(void) */ MMRESULT WINAPI timeGetSystemTime(LPMMTIME lpTime, UINT wSize) {
- if (wSize >= sizeof(*lpTime)) {
- lpTime->wType = TIME_MS;
- lpTime->u.ms = GetTickCount();
lpTime->wType = TIME_MS;
lpTime->u.ms = timeGetTime();
}
return 0;
}
+/**************************************************************************
timeGetTime [WINMM.@]
- */
+DWORD WINAPI timeGetTime(void) +{
- return GetTickCount();
+}
/**************************************************************************
timeSetEvent [WINMM.@]
*/ @@ -272,7 +278,7 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, return 0;
lpNewTimer->wDelay = wDelay;
- lpNewTimer->dwTriggerTime = GetTickCount() + wDelay;
lpNewTimer->dwTriggerTime = timeGetTime() + wDelay;
/* FIXME - wResol is not respected, although it is not clear that we could change our precision meaningfully */
diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index 9075a78f343..eea29ea61e5 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -1030,7 +1030,7 @@ static DWORD midistream_get_playing_position(WINE_MIDIStream* lpMidiStrm) case MSM_STATUS_PAUSED: return lpMidiStrm->dwElapsedMS; case MSM_STATUS_PLAYING:
return GetTickCount() - lpMidiStrm->dwStartTicks;
default: FIXME("Unknown playing status %hu\n", lpMidiStrm->status); return 0;return timeGetTime() - lpMidiStrm->dwStartTicks;
@@ -1080,7 +1080,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ if (lpMidiStrm->status != MSM_STATUS_PLAYING) { EnterCriticalSection(&lpMidiStrm->lock);
lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwElapsedMS;
lpMidiStrm->dwStartTicks = timeGetTime() - lpMidiStrm->dwElapsedMS; lpMidiStrm->status = MSM_STATUS_PLAYING; LeaveCriticalSection(&lpMidiStrm->lock); }
@@ -1090,7 +1090,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI /* FIXME: send out cc64 0 (turn off sustain pedal) on every channel */ if (lpMidiStrm->status != MSM_STATUS_PAUSED) { EnterCriticalSection(&lpMidiStrm->lock);
lpMidiStrm->dwElapsedMS = GetTickCount() - lpMidiStrm->dwStartTicks;
lpMidiStrm->dwElapsedMS = timeGetTime() - lpMidiStrm->dwStartTicks; lpMidiStrm->status = MSM_STATUS_PAUSED; LeaveCriticalSection(&lpMidiStrm->lock); }
@@ -1126,7 +1126,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI case WINE_MSM_HEADER: /* sets initial tick count for first MIDIHDR */ if (!lpMidiStrm->dwStartTicks)
lpMidiStrm->dwStartTicks = GetTickCount();
lpMidiStrm->dwStartTicks = timeGetTime(); lpMidiHdr = (LPMIDIHDR)msg->lParam; lpData = (LPBYTE)lpMidiHdr->lpData; TRACE("Adding %s lpMidiHdr=%p [lpData=0x%p dwBytesRecorded=%u/%u dwFlags=0x%08x size=%lu]\n",
@@ -1235,8 +1235,8 @@ start_header:
dwToGo = lpMidiStrm->dwStartTicks + lpMidiStrm->position_usec / 1000;
TRACE("%u/%u/%u\n", dwToGo, GetTickCount(), me->dwDeltaTime);
while (dwToGo - (dwCurrTC = GetTickCount()) <= MAXLONG) {
TRACE("%u/%u/%u\n", dwToGo, timeGetTime(), me->dwDeltaTime);
if (MsgWaitForMultipleObjects(0, NULL, FALSE, dwToGo - dwCurrTC, QS_ALLINPUT) == WAIT_OBJECT_0) { /* got a message, handle it */ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) {while (dwToGo - (dwCurrTC = timeGetTime()) <= MAXLONG) {
diff --git a/dlls/winmm/winmm.spec b/dlls/winmm/winmm.spec index 9c6ed2dfa83..d7c7379d77c 100644 --- a/dlls/winmm/winmm.spec +++ b/dlls/winmm/winmm.spec @@ -147,7 +147,7 @@ @ stdcall timeEndPeriod(long) @ stdcall timeGetDevCaps(ptr long) @ stdcall timeGetSystemTime(ptr long) -@ stdcall timeGetTime() kernel32.GetTickCount +@ stdcall timeGetTime() @ stdcall timeKillEvent(long) @ stdcall timeSetEvent(long long ptr long long) @ stdcall waveInAddBuffer(long ptr long) -- 2.28.0