Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.7 KB

ntwaitformultipleobjects.md

File metadata and controls

27 lines (22 loc) · 1.7 KB

Waits for one or more object to enter a signaled state.

Parameters

  • Count - the number of handles passed in the Handles parameter, up to MAXIMUM_WAIT_OBJECTS (64).
  • Handles - a pointer to an array of handles. Each handle must grant SYNCHRONIZE access.
  • WaitType - the type of wait to perform, either WaitAll or WaitAny.
  • Alertable - determines whether the wait should be altertable. This allows external triggers (such as APCs or calls to NtAlertThread) to interrupt wait prematurely.
  • Timeout - an optional pointer to a variable that stores the wait internal. A negative value indicates relative timeout for the specified number of 100-nanosecond intervals. To wait a specific number of milliseconds, multiply them by -10,000. Positive values indicate an absolute time. NULL indicates an infinite timeout.

Notable return values

  • STATUS_WAIT_0..STATUS_WAIT_63 - the thread woke due to the n'th object being signaled.
  • STATUS_ABANDONED_WAIT_0..STATUS_ABANDONED_WAIT_63 - the thread woke due to the n'th passed mutex becoming abandoned.
  • STATUS_TIMEOUT - the thread woke due to the timeout.
  • STATUS_USER_APC - the wait was interrupted by an APC.
  • STATUS_ALERTED - the wait was interrupted by a call to NtAlertThread.

Remarks

Despite the name, NtAlertThreadByThreadId is unrelated to alertable waits and cannot interrupt them.

Related Win32 API

See also

  • NtWaitForSingleObject
  • NtDelayExecution
  • NtAlertThread
  • NtQueueApcThread