Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function returns when one of the following occurs:
DWORD WaitForMultipleObjects( DWORD nCount , CONST HANDLE * lpHandles , BOOL fWaitAll , DWORD dwMilliseconds );
Parameters
Return Values
If the function succeeds, the return value indicates the event that caused the function to return. This value can be one of the following.
WAIT_FAILED indicates failure. To get extended error information, call GetLastError.
Remarks
Windows CE versions 1.0 through 2.12 does not support waiting for semaphores, change notification objects, input, and timers. Windows 3.0 and later supports waiting for semaphores.
For Windows CE versions 1.0 and 1.01, this function cannot wait on process or thread handles.
The WaitForMultipleObjectsfunction determines whether the wait criteria have been met. If the criteria have not been met, the calling thread enters an efficient wait state, consuming very little processor time while waiting for the criteria to be met.
The time-out value needs to be a positive number between 0 and 0x7FFFFFFF. The maximum time-out value not equal to infinity is 0x7FFFFFFF. The infinite time-out value is 0xFFFFFFFF. Any time-out value between 0x7FFFFFFF and 0xFFFFFFFF—that is, values from 0xF0000000 through 0xFFFFFFFE—is equivalent to 0x7FFFFFFF. If you need a bigger time-out value than the maximum of 0x7FFFFFFF, use the value for infinity (0xFFFFFFFF).
Before returning, a wait function modifies the state of some types of synchronization objects. Modification occurs only for the object or objects whose signaled state caused the function to return. When fWaitAllis FALSE, and multiple objects are in the signaled state, the function chooses one of the objects to satisfy the wait; the states of the objects not selected are unaffected.
The WaitForMultipleObjectsfunction can specify handles of any of the following object types in the lpHandlesarray:
Use caution when calling the wait functions and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. A thread that uses a wait function with no time-out interval may cause the system to become deadlocked. Two examples of code that indirectly creates windows are DDE and COM CoInitialize. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjectsor MsgWaitForMultipleObjectsEx, rather than WaitForMultipleObjects.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.01 and later | Winbase.h | Nk.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
CreateEvent, CreateFile, CreateMutex, CreateProcess, CreateThread, PulseEvent, ResetEvent, SetEvent, WaitForSingleObject