Implemented WaitForInputIdle.
diff --git a/windows/message.c b/windows/message.c
index b21f809..91dc327 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -1933,6 +1933,7 @@
DWORD i;
HANDLE handles[MAXIMUM_WAIT_OBJECTS];
DWORD ret;
+ PDB * pdb = PROCESS_Current();
HQUEUE16 hQueue = GetFastQueue16();
MESSAGEQUEUE *msgQueue = (MESSAGEQUEUE *)QUEUE_Lock( hQueue );
@@ -1968,6 +1969,7 @@
/*
* Check the handles in the list.
*/
+ SetEvent ( pdb->idle_event );
ret = WaitForMultipleObjects(nCount, pHandles, fWaitAll, 5L);
/*
@@ -2000,9 +2002,13 @@
/* Add the thread event to the handle list */
for (i = 0; i < nCount; i++)
handles[i] = pHandles[i];
- handles[nCount] = msgQueue->hEvent;
+ handles[nCount] = msgQueue->hEvent;
- ret = WaitForMultipleObjects( nCount+1, handles, fWaitAll, dwMilliseconds );
+ if ( pdb->main_queue == INVALID_HANDLE_VALUE16 ) pdb->main_queue = hQueue;
+ if ( pdb->main_queue == hQueue ) SetEvent ( pdb->idle_event );
+ ret = WaitForMultipleObjects( nCount+1, handles, fWaitAll, dwMilliseconds );
+ if ( pdb->main_queue == hQueue ) ResetEvent ( pdb->idle_event );
+
}
QUEUE_Unlock( msgQueue );
@@ -2488,8 +2494,7 @@
{
struct timeval t;
gettimeofday( &t, NULL );
- /* make extremely compatible: granularity is 25 msec */
- return ((t.tv_sec * 1000) + (t.tv_usec / 25000) * 25) - MSG_WineStartTicks;
+ return ((t.tv_sec * 1000) + (t.tv_usec / 1000)) - MSG_WineStartTicks;
}