user32: Fix tick counter wrap-around handling.

This commit is contained in:
Alexandre Julliard 2013-10-21 14:48:01 +02:00
parent 5435dad997
commit 7b2eafbc8a
1 changed files with 4 additions and 6 deletions

View File

@ -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;