Waits until either the specified object is in the signaled state, or until the time-out interval elapses.
DWORD WaitForSingleObject(
    HANDLE hHandle,
    DWORD dwMilliseconds
);
DWORD RtWaitForSingleObject(
    HANDLE hHandle,
    DWORD dwMilliseconds
);
hHandle 
dwMilliseconds 
dwMilliseconds is zero, the function tests the object's state and returns immediately. If dwMilliseconds is INFINITE, the function's time-out interval never elapses. These functions cannot be called from a pure INtime thread.
The handle can refer to an object of the following type:
You can also use RtWaitForSingleObject from a Windows application to wait for an iwin32 object. In that environment, when a mutex causes a change in a thread's priority, the thread is part of the iwin32x proxy; it is not the Windows thread!
| WAIT_OBJECT_0 | Success. The specified object's state is signaled. | 
| WAIT_ABANDONED_0 | Success. The specified object was deleted while waiting. | 
| WAIT_TIMEOUT | Success. The time-out interval elapsed, and the object's state is nonsignaled. | 
| WAIT_FAILED | Failure. Waiting on an invalid handle causes this function to return WAIT_FAILED. | 
For extended error information, see GetLastError.
| Versions | Defined in | Include | Link to | 
|---|---|---|---|
| INtime 3.0 | intime/rt/include/iwin32.h intime/rt/include/winbase.h  | 
iwin32.h windows.h  | 
iwin32.lib | 
Notes
PulseEvent, ResetEvent, SetEvent, WaitForMultipleObjects, iwin32 API, iwin32 Overview