From 7b2eafbc8a7073cb70c4eb4d19691ef5c25807b0 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 21 Oct 2013 14:48:01 +0200 Subject: [PATCH] user32: Fix tick counter wrap-around handling. --- dlls/user32/dde_client.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/user32/dde_client.c b/dlls/user32/dde_client.c index 91e15495290..7a30ed25272 100644 --- a/dlls/user32/dde_client.c +++ b/dlls/user32/dde_client.c @@ -1017,22 +1017,20 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h */ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, const WDML_XACT* pXAct, DWORD *ack) { - DWORD dwTime; + DWORD start, elapsed; DWORD err; WDML_CONV* pConv; TRACE("Starting wait for a timeout of %d ms\n", dwTimeout); - /* FIXME: time 32 bit wrap around */ - dwTimeout += GetCurrentTime(); - - while ((dwTime = GetCurrentTime()) < dwTimeout) + start = GetTickCount(); + while ((elapsed = GetTickCount() - start) < dwTimeout) { /* we cannot be in the crit sect all the time because when client and server run in a * single process they need to share the access to the internal data */ if (MsgWaitForMultipleObjects(0, NULL, FALSE, - dwTimeout - dwTime, QS_POSTMESSAGE) == WAIT_OBJECT_0) + dwTimeout - elapsed, QS_POSTMESSAGE) == WAIT_OBJECT_0) { MSG msg;