Commit 7b2eafbc authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Fix tick counter wrap-around handling.

parent 5435dad9
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment