mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 03:30:58 +00:00
user32: Fix tick counter wrap-around handling.
This commit is contained in:
parent
5435dad997
commit
7b2eafbc8a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue