#ifndef _NTTP_H
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
// winbase:SetThreadpoolWaitEx
/**
* TpSetWaitEx contract.
*
* \param Wait Wait object to update.
* \param Handle Object to wait for, or NULL to disarm.
* \param Timeout Optional native-time timeout.
* \param Reserved Must be NULL.
* \remarks Handle NULL disarms the association; a non-NULL Timeout uses LARGE_INTEGER native time units. The Ex Reserved argument must be NULL.
* The Ex result is a 32-bit LOGICAL prior-association cancellation result, not NTSTATUS; FALSE can accompany a valid new association. Rearming/disarming does not forcibly terminate a callback already running.
*/
NTSYSAPI
LOGICAL
NTAPI
TpSetWaitEx(
_Inout_ PTP_WAIT Wait,
_In_opt_ HANDLE Handle,
_In_opt_ PLARGE_INTEGER Timeout,
_Reserved_ PVOID Reserved
);
View code on GitHubSets the wait object, replacing the previous wait object, if any. A worker thread calls the wait object's callback function after the handle becomes signaled or after the specified timeout expires.
SetThreadpoolWaitEx maps directly to this function.