TimedOperationWaitForSingleObject function

The TimedOperationWaitForSingleObject function puts the current thread into a wait state until the given dispatcher object is set to a signaled state or optionally until the wait times out or until the time-out of the given timed operation expires.


NTSTATUS (*TimedOperationWaitForSingleObject)(
  _In_      PVOID Object,
  _In_      KWAIT_REASON WaitReason,
  _In_      KPROCESSOR_MODE WaitMode,
  _In_      BOOLEAN Alertable,
  _In_opt_  const LARGE_INTEGER *Timeout


Op [in, out]

[in] A pointer to a DXGK_TIMED_OPERATION structure that describes the timed operation to put into a wait state. This timed operation was started by a call to the TimedOperationStart function.

Object [in]

A pointer to an initialized dispatcher object that the caller supplies the storage for. The dispatcher object can be an event, a mutex, a semaphore, a thread, or a timer.

WaitReason [in]

A KWAIT_REASON-typed value that specifies the reason for the wait. A driver should set this value to Executive or, if the driver is doing work on behalf of a user and is running in the context of a user thread, to UserRequest.

WaitMode [in]

A KPROCESSOR_MODE-typed value that specifies the processor mode the driver waits in. The value can be either KernelMode or UserMode. Lowest-level and intermediate drivers should specify KernelMode. If the object that is pointed to by the Object parameter is a mutex, the caller must specify KernelMode.

Alertable [in]

A Boolean value that specifies whether the wait is alertable. A value of TRUE indicates that the wait is alertable; FALSE indicates that the wait is nonalertable.

Timeout [in, optional]

A pointer to variable that contains the relative time, in 100-nanoseconds units, for the wait to be completed. The sign of the value is ignored.

Return value

TimedOperationWaitForSingleObject returns one of the following values:

Return codeDescription

The dispatcher object that the Object parameter points to satisfied the wait.


The wait completed because the thread was alerted.


A user-mode APC was delivered before the interval that the Timeout parameter points to expired.


A time-out occurred before the dispatcher object that the Object parameter points to was set to a signaled state or the time-out of the timed operation that the Op parameter points to expired. This value is returned when the specified set of wait conditions cannot be immediately met and the interval that the Timeout parameter points to is set to zero.




Available in Windows Vista and later versions of the Windows operating systems.


Dispmprt.h (include Dispmprt.h)



See also




Send comments about this topic to Microsoft

© 2014 Microsoft